turning off 2 bytes loading address
nippur72 opened this issue · 6 comments
currently the output file does include the 2 bytes for the loading address at the start -- which is fine for loading in the emulator but inconvenient if you want to include it as a binary for another assembly source file.
Can be it turned off in some way?
Not yet, but can add it. Not sure if I manage to do so today, though.
I've added it and tested it briefly. It seems to work. Just compile the program with /addressheader=false and the two additional bytes should be skipped.
Settings this to false will prevent the BASIC header from being written as well.
is this a feature or a side effect? Because in my build chain it's useful to have the BASIC header ON and the address OFF (not a real issue I can put a basic header with the assembler). Perhaps the generation of the header could be a separate command line options.
Well, I failed to see the point in having a BASIC header but not the address bytes, so I coupled these two. I could decouple it but as you've mentioned, that would require an additional parameter and some changes to the logic of when the BASIC header is being added and when not.
Still...what's the point in having a BASIC header but not address bytes?
If you wanted a mixed program, half basic and half assembly you could do something like this:
org 2049
include binary "some_bas_compiled_with_mospeed.bin"
assembly_part:
rts
So the .bin
needs to NOT have the address bytes but you still want the BASIC header so that it can bootstrap itself.
I do this in my 3dfun program, where I had to add the stub:
#ifdef MOSPEED
basic start
10 sys {mospeed_part}
basic end
mospeed_part:
#endif
#ifdef MOSPEED then include binary "compiled.bin"
(there I use my asmproc language/assembler but the concept is the same for a generic assembler.
I see. I've made it so now that the address bytes and the basic header are independent of each other. Omitting the bytes has no influence on the basic header anymore.