flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [fasmg] Working w/ Windows resource scripts ...

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 10 Nov 2024, 00:25
fasmg can read the constant directly from the RC file:

import_c_define.g
Code:
; import C/C++ preprocessor style defines (just numbers for now)
; usage:
;       include "import_c_define.g",THE_FILE equ "app.rc"

calminstruction reader line&
        match =mvmacro? =reader? =, =?,line
        jno go
        assemble line
skip:   exit

go:     match =#=define? name= value // any?,line
        jyes ok
        match =#=define? name= value,line
        jno skip
ok:     arrange line,name =:== value
        assemble line
end calminstruction
include THE_FILE,mvmacro ?,reader
mvmacro reader,?
purge reader    
... the include parsing of fasmg insures this will follow nested files. The #defines can get complex - I just haven't had a need for any of that.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 10 Nov 2024, 00:25
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.