How to retarget SDCC

  • Gorf

    Hi everyone,

    My ultimate questions is, what kind of nightmare am I asking for?

    What would it take to re-target SDCC to output Jaguar RISC assembler?

    Not knowing anything about SDCC or how it actualy works, I assume there
    is some sort of machine descriptor file(s)? Is this reasonable to try if
    you've never tried to re-target a machine before?

    The RISC's in the Atari Jaguar are 32 bits. The have 64 instructions total.
    Most are register to register operations with a few quick data and one large
    immediate instruction. 2 banks of 32 x 32 bit registers and a small 4k local
    ram(if this matters.)

    All instructions fit in 16 bits.

    iiiiii sssss ddddd

    6 bits instruction opcode, 5 bits source reg/#data,  and 5 bits destination reg

    The one exception is the

    MOVEI #LargeImmediate(32bit),reg

    The instruction itself is 16 bit decoded but the LARGE follows the instruction in
    the next 32 bits of space.

    iiiiii sssss ddddd
    xxxxxx xxxxx xxxxx
    xxxxxx xxxxx xxxxx

    So actually, it really is decoded the same but needs to extra 16 bit 'slots' if
    you will for the immediate data.

    I have a complete list of the instructions and the actually Atari official
    documents with cycle times and all that. All I need is a point in the right
    direction on where to start.

    feel free ro e-mail me at

    Thanks trillions!


    • Maarten Brock
      Maarten Brock


      SDCC is targeted at small devices, where small is best interpreted as 8 bit microcontroller/microprocessor. I think with a 32 bit controller you're much better off trying to retarget GCC to it.

      With this said, if you're still interested, have a look at the source code in any of the targets src/ subdirectory, like src/mcs51/ to see what it takes to create a new target.


      • Gorf

        I really would rather NOT use GNU/GCC as it is just entirely too big.
        Is there something like SDCC for wide bit processors that would not
        be to crazy to implement?