flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
baldr 09 Nov 2008, 13:52
revolution,
My question was about inconsistent handling of dword 1.0 in bare fasm, not heavily macro'ed one. Out of context, mea maxima culpa. ![]() |
|||
![]() |
|
Tomasz Grysztar 09 Nov 2008, 13:57
Still, what revolution said contains also some truth about bare fasm.
![]() |
|||
![]() |
|
wht36 09 Nov 2008, 14:01
baldr wrote: Your macro definition use implicit forward, may explicit common be of some use? Code: macro dd [op] { common big_endian dd op } Is this what you mean? Would there be a difference when there is only one line of instruction? |
|||
![]() |
|
LocoDelAssembly 09 Nov 2008, 14:43
Seems there was some confusion when I've said ".:", I meant this:
Code: struc PascalStr [string]{ common local size .: db size forward db string common size = $ - . - 1 } string PascalStr "Hello World", " Now I also understand what could was my problem, by not defining ".:" the "size = $ - ." throws "Error: Undefined symbol 'string'". Since almost every time I use a struc I use the . label for something I ended up believing that it was always needed to be defined. Anyway seems that it was recommended to use the dot anyway because of the label type ![]() Code: struc dd [arg] {common dd arg} struc dw [arg] {common . dw arg} a dd 0 b dw 0 mov ax, [a] ; accepted mov eax, [b] ; Rejected -> "Error: Operand sizes do not match." |
|||
![]() |
|
baldr 09 Nov 2008, 15:15
wht36,
The difference is one big_endian macro invokation vs. possibly several of them for each dd macro argument. Code: ;macro big_endian defined somewhere above macro dd [op] { common big_endian dd op } dd 1.0,2.0,3.0; dd will expand to ; big_endian dd 1.0,2.0,3.0 macro dd [op] { big_endian dd op } dd 1.0,2.0,3.0; dd will expand to ; big_endian dd 1.0 ; big_endian dd 2.0 ; big_endian dd 3.0 |
|||
![]() |
|
wht36 09 Nov 2008, 17:36
baldr wrote: wht36, I see ![]() |
|||
![]() |
|
baldr 09 Nov 2008, 18:22
LocoDelAssembly,
common/forward issue again? Code: struc PascalStr [string] { common local ..size . db ..size db string ..size = $ - . - 1 } hello_str PascalStr "Hello, World!", 7, 13, 10, " |
|||
![]() |
|
LocoDelAssembly 09 Nov 2008, 18:32
Quote:
Assembly layer variables does not affect scope. Quote:
Perhaps my "db" is a macro/struc that does not accept multiple arguments ![]() |
|||
![]() |
|
baldr 09 Nov 2008, 18:55
LocoDelAssembly,
I mean more generic case, when you have to define labels with unique names for each macro invocation. struc w/o label? Teach me, I need it badly! ![]() |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.