flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
crc 05 Sep 2004, 21:12
You'd probably want to put the strings in a '.data' section, but this should work for zero terminated strings:
Code: macro string id, value { id db value, 0 } |
|||
![]() |
|
Dragontamer 06 Sep 2004, 00:14
The point of the macro is to put the string into the '.data' section automatically
Else i would just jump the string. |
|||
![]() |
|
Dragontamer 06 Sep 2004, 00:27
Just to let you know, i already read:
http://board.flatassembler.net/topic.php?t=1166 And it doesn't suit this specific purpose. However... I think i'll start using it anyway. I'll try a bit better this time with the explanation of what i want... Code: section '.text' main: string name, "Hello World!!" push name call printf add esp, 4 ret Should turn into: Code: section '.text' main: push name call printf add esp, 4 ret section '.data' name db "Hello World!!", 0 |
|||
![]() |
|
pelaillo 06 Sep 2004, 01:27
There is a globals.inc in fresh includes you could find useful.
|
|||
![]() |
|
vid 06 Sep 2004, 14:57
yes, include globals inc and then yours macro is:
Code: macro string,name,data { iglobal name db,data,0 endg } |
|||
![]() |
|
Dragontamer 06 Sep 2004, 16:56
Hopefully i can change that to:
Code: struc string, [data] { iglobal name db,data,0 endg } Right? |
|||
![]() |
|
vid 07 Sep 2004, 18:30
yes (except that you didn't declare "name" argument), but it would be faster this way
Code: struc string, [name,data] { common iglobal forward name db data,0 common endg } or (if you want one nam for all strings) Code: struc string, [name,data] { common iglobal label name byte forward db data,0 common endg } |
|||
![]() |
|
JohnFound 08 Sep 2004, 07:08
The last one should be:
Code: struc string, name, [data] btw, there is a macro "constStr" in "globals.inc" that works similar way. Regards. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.