flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Is it possible to detect label type (code or data)? |
Author |
|
revolution 31 May 2013, 09:21
When you use a colon (:) to define the label there is no type attached to the label. So in your example there is no way to know just from the label name whether the following lines are data or instructions.
If you use a data definition to define a label then it might be possible, although I haven't thought about how yet: Code: datalabel db 0 ;define datalabel without using a colon and the type "byte" is now part of the label |
|||
31 May 2013, 09:21 |
|
cod3b453 31 May 2013, 16:13
You can override the dx's with struc's to define an internal marker:
Code: struc db [x] { common .__isdata = 1 forward db x } macro isData id { if defined id#.__isdata display 'DATA',0x0D,0x0A else display 'CODE?',0x0D,0x0A end if } test0: xor eax,eax test1 db 'blah',0,'blah' test2: db 'blah',0,'blah' isData test0 isData test1 isData test2 |
|||
31 May 2013, 16:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.