flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > String pointer table |
Author |
|
revolution 17 Dec 2010, 15:49
If you use "label ." then you have to use struc (not macro).
Use local to generate unique names Code: struc stringtable [strings*] { common label . forward local ..n dd ..n forward ..n: db strings } |
|||
17 Dec 2010, 15:49 |
|
bitRAKE 17 Dec 2010, 15:52
Is this sufficient?
Code: macro A [B*] { ; forward ; this is implied - not needed local ..t dd ..t forward ..t db B } .: A 'zero','one',<'two',13,10,0>,'three' |
|||
17 Dec 2010, 15:52 |
|
mindcooler 17 Dec 2010, 15:57
revolution: Actually it was struc originally, I changed it while testing. This should work! Just need to add some .sizes.
bitRAKE: The only difference is that I would need to use label with a : to address the list? edit: how can I define .size constants when the labels are local? |
|||
17 Dec 2010, 15:57 |
|
bitRAKE 17 Dec 2010, 16:12
There isn't any size checking for ":" labels - be careful, FASM will not error on mov al,[.] - iirc, no different than using "label .".
Code: struc A [B*] { common .: forward local ..t dd ..t common .entries = ($-.) shr 2 forward ..t db B } |
|||
17 Dec 2010, 16:12 |
|
mindcooler 18 Dec 2010, 18:41
I did it like this, interleaved pointers with string lengths:
Code: struc stringtable [strings*] { common label . forward local ..n dd ..n dd ..n#.size forward ..n: db strings ..n#.size=$-..n } _________________ This is a block of text that can be added to posts you make. |
|||
18 Dec 2010, 18:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.