[Coco] Assembly .BIN -> .CCC/.ROM = SOLVED!

Tormod Volden lists.tormod at gmail.com
Thu Sep 4 16:22:50 EDT 2014


On Thu, Sep 4, 2014 at 4:31 PM, Johann Klasek wrote:
> Putting altogether:
>
>         org     49152           CoCo and compatibles map in ROM Paks here
>
>         * LOADER
> BININ   LDX     #BINLOD         INIT XFER DATA ADDRESS OFFSET
> CHKBLK  LDA     ,X+             GET BLOCK TYPE BYTE (00 = PREAMBLE, 255=POSTAMBLE)
>         BNE     ENDBIN          IF <>0 THEN MUST BE END OF .BIN DATA (POSTAMBLE)
>         LDY     ,X++            GET BLOCK LENGTH(Y)
>         LDU     ,X++            GET BLOCK START ADDRESS(U)
> XFER    LDA     ,X+             GET SOURCE BYTE(A) FROM X
>         STA     ,U+             PUT BYTE(A) AT U
>         LEAY    -1,Y            MOVED BLOCK?
>         BNE     XFER            NO
>         BRA     CHKBLK          CHECK NEXT BLOCK
> ENDBIN  JMP     [2,X]           SKIP BLOCK LENGTH (0000)
>                                 AND JUMP TO EXECUTION ADDRESS
> BINLOD  FCB     255
>
>
> Anything wrong with this?

Why the FCB at the end, anyway?

If you want to keep it relocatable you should use LEAX BINLOAD,PCR

Tormod


More information about the Coco mailing list