Use labels in inline asm code

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Use labels in inline asm code

Post by Trond »

Suggestion: Allow code like this:

Code: Select all


JMP mylabel

mylabel:

Since we can do that with variables it would be nice to do it with labels, too. Of course we can use l_ in front of it, but still I'd like to see this.
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

Code: Select all

!JMP l_mylabel

Debug "no jump"
End

mylabel:
Debug "jump"
Dri
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Use labels in inline asm code

Post by Trond »

Trond wrote:Of course we can use l_ in front of it, but still I'd like to see this.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Some people "sometimes" forget this is a feature request and not a tip request.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

The good thing from this syntax is, that it allows us to do this:

Code: Select all

a=?label
JMP a

Debug "Im actually not shown!"

label:

Debug "Im the only line in your debugger!"
And yes i have used that :)
Now we can have both labels and variables with the same name..
And otherwise the compiler would need to check if the given thing is a label or an variable to get the value from!
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I ssuport the request, it's not the same "JMP [address]" to "JMP address".
El_Choni
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Code: Select all

!JMP eti 

Debug "Im actually not shown!" 
eti:!eti: 

Debug "Im the only line in your debugger!"
Are there too much work to add a '!' ?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Re: Use labels in inline asm code

Post by Dr. Dri »

Trond wrote:
Trond wrote:Of course we can use l_ in front of it, but still I'd like to see this.
didn't see that :oops:

Dri
Post Reply