flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 12 Nov 2005, 13:42
As there are no such macros in official fasm macro set, please post the macros that you're using, too.
|
|||
![]() |
|
decard 12 Nov 2005, 14:00
You didn't forgot about IncludeAllGlobals, did you?
![]() Can you post your macros? With macros form Fresh package you you can declare two or more data blocks one after another, without 'undefined symbol error'. Code: macro iglobal { IGlobals equ IGlobals, macro __IGlobalBlock { } macro uglobal { UGlobals equ UGlobals, macro __UGlobalBlock { } endg fix } macro IncludeIGlobals { macro IGlobals dummy,[n] \{ __IGlobalBlock purge __IGlobalBlock \} match I, IGlobals \{ I \} } macro IncludeUGlobals { macro UGlobals dummy,[n] \{ \common \local begin, size begin = $ virtual at $ \forward __UGlobalBlock purge __UGlobalBlock \common size = $ - begin end virtual rb size \} match U, UGlobals \{ U \} } macro IncludeAllGlobals { IncludeIGlobals align 4 IncludeUGlobals } BTW I added 'align 4' to IncludeAllGlobals in latest package. |
|||
![]() |
|
Reverend 12 Nov 2005, 14:54
I don't get it. It works now. I used macros provided by vid for FASMLIB and comparing line by line it was nearly identical. The difference was only macro-arguments name, or sth like this. I have no idea why didn't it work, but thanks anyway for help
|
|||
![]() |
|
decard 12 Nov 2005, 16:34
strange
![]() I was thinking about improving this macros, so for instance such construction would be possible: Code: uglobal
sth dd ?
iglobal
sth2 db 'safsaf'
endg so iglobal and uglobal macros will automatically close previous blocks if necessary, thus data declarations will look a little nicer ![]() |
|||
![]() |
|
Tomasz Grysztar 12 Nov 2005, 20:25
I think something like this should do the trick:
Code: macro _iglobal dummy { IGlobals equ IGlobals, macro __IGlobalBlock { } macro _uglobal dummy { UGlobals equ UGlobals, macro __UGlobalBlock { } iglobal fix _iglobal } _iglobal uglobal fix _uglobal } _uglobal endg fix } macro IncludeIGlobals { macro _iglobal dummy \{ \} macro _iglobal dummy \{ \} macro IGlobals dummy,[n] \{ __IGlobalBlock purge __IGlobalBlock \} match I, IGlobals \{ I \} } macro IncludeUGlobals { macro _iglobal dummy \{ \} macro _iglobal dummy \{ \} macro UGlobals dummy,[n] \{ \common \local begin, size begin = $ virtual at $ \forward __UGlobalBlock purge __UGlobalBlock \common size = $ - begin end virtual rb size \} match U, UGlobals \{ U \} } |
|||
![]() |
|
decard 12 Nov 2005, 23:15
OK it works, assuming you wanted to write
Code: macro IncludeIGlobals { macro _uglobal dummy \{ \} macro _uglobal dummy \{ \} macro IGlobals dummy,[n] \{ __IGlobalBlock purge __IGlobalBlock \} match I, IGlobals \{ I \} } I think that I can understand how it works (more or less ![]() |
|||
![]() |
|
Tomasz Grysztar 12 Nov 2005, 23:37
Oh, it had to be:
Code: macro _iglobal dummy \{ \} macro _uglobal dummy \{ \} in both cases. |
|||
![]() |
|
decard 13 Nov 2005, 00:05
OK, it works. Thanks!
BTW you don't sleep at nights, do you? ![]() |
|||
![]() |
|
Reverend 13 Nov 2005, 11:59
Allright, nice addition to these macros. I find it useful and in fact I'd like to use it in my programs, but there's a problem with unifying standards in FASMLIB. What do you coders of FASMLIB think of that? And also we should change the name to idata/udata as such solution won the poll
|
|||
![]() |
|
decard 13 Nov 2005, 16:11
In next Fresh release I'm going to change iglobal/uglobal to idata/udata, I think they are better names, so that's no issue.
|
|||
![]() |
|
vid 14 Nov 2005, 15:59
sorry, i wasn't here some time. something wrong with m rewrite of macros? i thin comments there come useful for newbies studying them... but i wass rewrtiing them in hurry, so i may have left something there of course...
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.