flat assembler
Message board for the users of flat assembler.
Index
> Main > How to implement C style union in FASM Assembly? |
| Author |
|
|
Tomasz Grysztar 19 Nov 2026, 06:46
robstat7 wrote: For the second union, are comments as 4 bytes and 2 bytes enough? Code: label .di_a : dword at .union2 label .di_b : byte at .union2 There is also VIRTUAL, and the manual mentions its usefulness to create unions: Code: .di_a dd ? virtual at .di_a .di_b db ? end virtual |
|||
|
|
robstat7 19 Nov 2026, 07:13
Thank you so much. It really helped.
|
|||
|
|
DimonSoft 19 Nov 2026, 11:55
But unions used to be implemented in macro\struct.inc and even described in FASM.pdf, AFAIR. Something along the lines of
Code: struct MyStruct field1 dd ? field2 dw ? union field3 dd ? struct Low dw ? High dw ? ends ends ends If my memory serves me. Is there really any reason to avoid those? Might not be the best syntax ever, but works. (Although, I guess, I never used them myself, except, maybe, standard .inc’s from EQUATES folder.) |
|||
|
|
revolution 19 Nov 2026, 12:10
OP is using raw fasm syntax, not the processed macro versions.
|
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.