It is currently Sun Feb 28, 2021 3:59 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: EnableASM and PureBasic labels
PostPosted: Mon Aug 25, 2014 11:25 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3698
Location: Italy
PB FASM labels in the past were generated from their PB name adding a l_ in front of it, while now they include the name of the procedure as well and a double "l" for the local labels, so they tend to be a KM long (a Mile for not Europeans) and the label you are forced to use in the JMPs does not match at all with the labels they are linked to.

Example:

Code:
EnableASM

Procedure.i GiveMeTheBiggerOne (a, b)
 MOV eax, a
 MOV ecx, b
 CMP eax, ecx
 
 JG ll_givemethebiggerone_skip  ; you need to write this ...

;JG skip ; this would obviously be better

 MOV eax, ecx
 
 skip: ; ... when you want to jump here
 
 ProcedureReturn
EndProcedure


Procedure.i GiveMeTheBiggerOne (a, b)
 MOV eax, a
 MOV ecx, b
 CMP eax, ecx
 
 !JG gmtbo_skip  ; or you can do this, bypassing EnableASM just for this

 MOV eax, ecx
 
 !gmtbo_skip: ; same here
 
 ProcedureReturn
EndProcedure



I think PB should consider all the references to labels made by instructions not using the "!" passthrough as PB labels and expand them accordingly when generating the FASM source, while leaving the labels referenced by "!" instructions as they are.

So labels inside inline asm would work as it is now, and inside EnableAsm would work like they work in BASIC (you use the high level label name and the code generated defines and call the actual low level asm label).

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye