[Coco] Programming help

Johann Klasek johann+coco at klasek.at
Fri Jun 28 05:51:26 EDT 2013


Just to summary up the thread - I'm not sure whether Bill was
successful in the meantime.

On Tue, Jun 25, 2013 at 10:18:52PM -0400, Arthur Flexser wrote:
> On Tue, Jun 25, 2013 at 7:22 PM, Mark McDougall <msmcdoug at iinet.net.au>wrote:
> > On 26/06/2013 2:13 AM, Bill wrote:
> >
> >  or there is something wrong with the old,
> >> modified Coco1 that I have.

> > Well for starters this will only work on a Coco 3... it's switching the
> > ROMs in and out with the $FFDE/$FFDF writes...

> Mark, the $FFDE/FFDF switch works fine on the CoCo 1/2, so long as
> interrupts are disabled and the ML program doesn't return to Basic without
> switching back to ROM mode first (or unless ROM has been copied to RAM).

The whole listing 2 which "runs" at least on my sim6809 environment (any
typos in comments left "as-is", just the first line and comment
character changed to suffice my assembler):

        TITLE B256

        ORG $0E00

        ORCC #$50
        LDX #$8000
        LDY #$FFC0      ; BANK 0

COPY    STB $FFDE
        LDB 0,Y
        LDA 0,X
        LDB $08,Y       ; BANK 00/00
        STB $FFDF
        STA 0,X
        LDB $09,Y       ; BANK 01/00
        STB $FFDF
        STA 0,X
        LDB $0A,Y       ; BANK 02/00
        STB $FFDF
        STA 0,X
        LDB $0B,Y       ; BANK 03/00
        STB $FFDF
        STA 0,X
        LDB 0,Y         ; BANK 00
        STB $FFDF
        LEAX 1,X
        CMPX #$FF00
        BNE COPY

        LDX #$ABEE      ; OK PROMPT

        LDB 0,Y         ; BANK 00
        STB $FFDF
        LDA #'>
        STA 0,X
        LDA #'0         ; BANK #
        STA 1,X

        LDB $09,Y       ; BANK 01/100
        STB $FFDF
        LDA #'>
        STA 0,X
        LDA #'1         ; BANK #
        STA 1,X

        LDB $0A,Y       ; BANK 02/00
        STB $FFDF
        LDA #'>
        STA 0,X
        LDA #'2         ; BANK #
        STA 1,X

        LDB $0B,Y       ; BANK 03/00
        STB $FFDF
        LDA #'>
        STA 0,X
        LDA #'3         ; BANK #
        STA 1,X

        LDB 0,Y         ; BANK 00

        RTS



On Tue, Jun 25, 2013 at 11:32:59AM -0400, Luis Antoniosi (CoCoDemus) wrote:
> You do type EXEC after the CLOADM ? There is no ANDCC to restore the
> interrupts so I think this program is just broken.
> 
> Listing 3 doesn't seem to exec anything on it. I really don't understand
> this code.

The text is inaccurate about this, using just the phrase "in conjunction
with". Probably this means that one have to know how to get the binary
from listing 2 into RAM and run it to initialize the banks (copy ROM
into the 4 upper banks and modify their prompts) just before run the
program from listing 3.


The program ends with a RTS, maybe a Basic EXEC restores the previously saved
CC register on stack which would make an explicit ANDCC #$AF unnecessary ...

Johann

-- 
The dragon on my side: http://klasek.at/hc/dragon/



More information about the Coco mailing list