Menu

#988 MOS6502 target is producing S2/S8 output format, Should be S1/S9.

None
open
nobody
None
5
2025-03-05
2025-02-27
No

I am compiling a small program for the mos6502 and want Motorola S record output format.
I expected the output to be S1/S9 records (16-bit addresses) but it is producing S2/S8 (24-bit addresses).
Most 6502 tools expect S1/S9 format.
This is how I am building it: sdcc -mmos6502 --out-fmt-s19 hello.c
I have built sdcc from the latest code in svn.

Discussion

  • Maarten Brock

    Maarten Brock - 2025-03-05

    Ticket moved from /p/sdcc/bugs/3839/

    Can't be converted:

    • _category: MOS6502
     
  • Maarten Brock

    Maarten Brock - 2025-03-05

    It should not be too hard for you to convert a 24-bit address S-record file to a 16-bit one. But if SDCC would only output 16-bit files then bank switching would no longer be possible.

    You can also look in the assembler/linker manual to find an option to output the 16-bit format and tell SDCC to pass that to the assembler and/or linker.

     
  • Jeff Tranter

    Jeff Tranter - 2025-03-05

    Yes, I was able to convert the file using the srec_cat utility.
    It would be a useful enhancement to support either S1/S9 or S2/S8 format directly from sdcc.

     

Log in to post a comment.

MongoDB Logo MongoDB