Closed raybellis closed 4 years ago
Makes sense. I'll look into it.
That's an interesting one, since it has two facettes when creating a binary output file:
OK, here's a little test version for you. This one adds a builtin constant called FILCHR, which defaults to $00. FILCHR is used in all empty areas in binary files that result from RMB or ORG.
You can set it either from the command line by adding something like -dFILCHR=$FF
to A09's invocation, or inside the assembler source by writing it as
FILCHR TEXT $FF
or whatever - the value can be anything that fits inside a byte, given in decimal, hexadecimal ($xx), octal (@xx), binary (%xx), or character ('x) notation.
In principle, you can use the constant anywhere, like, for example, in
FILL &FILCHR,10
and you can also change it multiple times throughout the source code; if you do so, it is VERY advisable to have a definition at the start of the assembler source file, as it's not reset between the assembler passes.
Please tell me whether this works for you.
Ironically I can't put the
FILL
directive at the address corresponding to the end of the unused block because thatORG
directive gets emitted first...).
dasmfw, my more modern, but not yet as stable, take on disassemblers, can do things like that, as it has an expanded syntax for COMMENT, INSERT etc. - you can define something like
insert after 1234 \ FILL $FF,10
for the last valid address before an UNUSED area. This would be output before the ORG
directive.
That's working perfectly, thank you! (and thanks for the quick response too).
Last "significant" issue, I hope :)
For symmetry with
f9dasm
, it would be really useful to have an option that specifies what byte is written to a binary for space that is not used. It currently uses0x00
, but many systems use0xff
instead.Granted this doesn't matter when A09 is being used on its own because I could use the
FILL
directive, but I'd like to get to the point where I can pass my binary intof9dasm
and then pass the unmodified assembly back intoA09
and get out the exact same binary.I have large data blocks that I had tagged as "UNUSED" in my project's
.info
file, but precisely because they're unused I'm unable to forcef9dasm
to use anINSERT
info line to emit aFILL
directive.The alternative is thousands of lines in the intermediate source reading
FCB $ff, $ff, $ff, ...
but that would be far from ideal. I cannot currently find any other way to coercef9dasm
andA09
to cooperate.(I note that semantically
f9dasm
does "the right thing" with UNUSED data and simply writes out anORG
directive at the start of the next used memory location - it's not having the semantic equivalent in A09 that's stumping me just now. Ironically I can't put theFILL
directive at the address corresponding to the end of the unused block because thatORG
directive gets emitted first...).