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

Chad H chadbh74 at hotmail.com
Thu Sep 4 18:27:25 EDT 2014


What's all this talk about 'relocatable".  The intent of this code is to utilize the addresses stored in the .BIN data for placement.  There's never a need to relocate the assembly code, it always loads at rompak beginning (49152).  If someone wants to change where the .BIN is loaded from the pak, they need to SAVEM it with the appropriate addresses.  The assembly is meant to be universal for ANY .BIN up to 16k.

On Sep 4, 2014 3:22 PM, Tormod Volden <lists.tormod at gmail.com> wrote:
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

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco


More information about the Coco mailing list