flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 10 Mar 2006, 12:29
of course... btw, most proper way is dot to dot:
Code: macro dot2 { local ..dot je ..dot nop ..dot: } |
|||
![]() |
|
shoorick 10 Mar 2006, 13:07
this also ok, but in pdf written:
...label whose name begins with dot is treated as local label, and its name is attached to the name of last global label (with name beginning with anything but dot) to make the full name of this label. So you can use the short name (beginning with dot) of this label anywhere before the next global label is defined,.. ... ...local directive defines local names, which will be replaced with unique values each time the macroinstruction is used. It should be followed by names separated with commas. If the name given as parameter to local directive begins with a dot or two dots, the unique labels generated by each evaluation of macroinstruction will have the same properties. This directive is usually needed for the constants or labels that macroinstruction defines and uses internally. For example: Code: macro movstr { local move move: lodsb... |
|||
![]() |
|
chris 10 Mar 2006, 14:14
Hi, shoorick
As stated in the manual, label begins with a dot is attached to the last global label, and this is done at assembling time. for example: Code: macro dot1 { je .dot nop .dot: } global1: dot1 global2: dot1 after preprocessing becomes: Code: ;macro dot1 ;{ ; je .dot ; nop ; .dot: ;} global1: ;dot1 je .dot nop .dot: global2: ;dot1 je .dot nop .dot: and it gets assembled correctly. When local directive is used to define a lable in macro, again, as stated in manual, a unique lable is generated each time the macro is expanded, for instance: Code: macro dot2 { local dot je dot nop dot: } dot2 dot2 after preprocessing becomes: Code: ;macro dot2 ;{ ; local dot ; je dot ; nop ; dot: ;} ;dot2 ; dot?0000000 je dot?0000000 nop dot?0000000: ;dot2 ; dot?0000001 je dot?0000001 nop dot?0000001: Note that two labels are generated by the preprocessor. Look in the FAQ for the fasm preprocessor tool. If you are using 1.65 package, look at here http://board.flatassembler.net/topic.php?t=4761 for the tweak. ![]() |
|||
![]() |
|
shoorick 10 Mar 2006, 14:31
then "local" directive defines global unic label, if it is not started with dot, or unic local, if it started with dot, as i understand (?) this should be specified (?)
thnx for example - i'll look there lately ![]() regards! |
|||
![]() |
|
Borsuc 11 Mar 2006, 13:53
local has nothing to do with local labels, though they use the same word.
![]() |
|||
![]() |
|
Ancient One 19 Mar 2006, 05:46
local is a preprocessor directive that ONLY defines a unique label, not necessarily global/local. only the presence of dot (single/double/nothing) in front of label will determine its scope. So if you use local like
Code: macro foo { local bar bar: } foo it will define unique, normal label but with Code: macro foo { local .bar .bar: } foo it will define unique, local label and with Code: macro foo { local ..bar ..bar: } foo will define unique, global label |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.