flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Put a global block anywhere |
Author |
|
zann 17 Nov 2012, 09:17
I've been using this globals macro for a while.
Its the struct macro copied and simplified since it only has to produce one unnamed instance and doesn't support unions and substructs. How to use: Anywhere before the data section, as often as you need, call for example Code: globals globalCount dd 0 mousePos POINT 12,12 Flags dd ? label gcb byte at Flags ;label here is actually a macro to insert a label ReferenceValues dd 1,2,4,8,16 align 8 ;macro to insert an align statement @i Handle,ThreadID=-1 ;define several integers with dq if _longmode equ 1 ;or dd if _longmode equ 0 @text DefaultFontFace,32,"Times" ;defines text with du if _unicode equ 1 ;db if _unicode equ 0, Number is count, not bytes Prefs flags ReadOnly,CaseSensitive ;Prefs becomes a dword field, Prefs.ReadOnly and ;Prefs.CaseSensitive are constant bit flags. endg IMPORTANT: in the data section, call write@globals.
|
|||||||||||
17 Nov 2012, 09:17 |
|
JohnFound 17 Nov 2012, 11:17
Check FreshLib globals.inc library. IMO, in this moment, this is the most advanced library for work with data definitions.
|
|||
17 Nov 2012, 11:17 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.