flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
zicklag 10 May 2025, 02:26
Oh, actually I just realized that it's pretty easy to use an unconditional macroinstruction to intercept all of the labels with a custom macro, but unfortunately I'm not seeing a way to generate the source map as a separate file.
As far as I can see fasmg only supports writing output to its main output file. Code: macro ?! line& match label_name:,line ; do custom stuff label label_name else line end match end macro |
|||
![]() |
|
dosmancer 10 May 2025, 03:29
zicklag wrote: Oh, actually I just realized that it's pretty easy to use an unconditional macroinstruction to intercept all of the labels with a custom macro, but unfortunately I'm not seeing a way to generate the source map as a separate file. I slightly more lightway approach than a "catch-all" macro is a "catch-all" struc See chapter 9 in https://flatassembler.net/docs.php?article=fasmg_manual#9 Code: struc (label) ? line& . line ; need to collect the label and address too somehow end struc To catch labels created with the `label` command you need to override the label command too: Code: macro label? line& label line ; need to collect the label and address too somehow end macro To output data to a separate other file you need to use `virtual`. See chapter 13 https://flatassembler.net/docs.php?article=fasmg_manual#13 So you need to collect label names together with the addresses and then output them in your desired format into the virtual output area with the store command. |
|||
![]() |
|
zicklag 10 May 2025, 16:07
Ah, the virtual blocks are exactly what I needed, thanks!
And now I understand labeled macroinstructions with the `struc` syntax. After some reading and experimenting I was able to get fasmg to output an MLB file so that I can get the labels imported to the Mesen NES emulator debugger! Thanks for the help! I'm having fun trying to get started writing an NES game with fasmg. So cool to be able to customize the assembler for a new platform like this. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.