fachat / xa65

6502/65816 cross assembler
http://www.floodgap.com/retrotech/xa/
55 stars 8 forks source link

file65 options to output segment addresses #16

Open fachat opened 5 months ago

fachat commented 5 months ago

To create proper load addresses from an o65 file, file65 should be able to extract a segment start address and print it either in hex (lo/hi), or other formats.

proposal:

fachat commented 5 months ago

.. and / or maybe add "-L" to write out the correct load address into the xt data output (in reloc65)

fachat commented 5 months ago

This is the alternative way of prepending the load address to an extracted binary (from a Makefile):

        file65 ../kern.o65 | grep text | tr -s " " | cut -d " " -f 5 | sed -e 's/\$$//g' -e 's/\(..\)\(..\)/\2 \1/' | xxd -r -p > kern.bin
        reloc65 -xt -o tmp ../kern.o65
        cat tmp >> kern.bin