[Coco] Color BASIC program on a cartridge?

Dave Philipsen dave at davebiz.com
Mon Aug 7 17:33:24 EDT 2017


Here's my code from back in '89 that essentially does the same as 
John's.  Some notable differences are that I cleared the warm reset 
flag, bumped almost immediately into hi-speed, called a couple of ROM 
routines, and instead of stuffing "RUN" into the command line buffer I 
just loaded X with the start of the BASIC program and jumped directly 
into the interpreter.  There's also an entry point that your BASIC 
program can use for ON BRK GOTO so that it re-starts the program if 
someone tries to press BREAK although it looks like there might be a 
problem with that portion of the code which could mess up the stack if 
you used it that way.  But I will say that the program was used for 
quite some time and I never heard of any problems.

Also, my code was quick and dirty hard-coded specifically for the BASIC 
program I had created. It was used for a customer order pickup system in 
a pizza restaurant chain.

Dave



* EPROM AUTO-LOAD/RUN PROGRAM FOR COCO 3
* with 4-keypad read routine.


*** EPROM MEMORY MAP ***

*    $0000-0008    init
*     00E0-XXXX    BASIC pgm loader
*     010C-0132    reinitialization routine
*     0400-XXXX    keypad read routine
*     08C0-XXXX    tokenized BASIC program (max 5.8K with 2764)


        org    $c000
        fcc    /DK/
        jmp    patch
pstrt  fdb    $2600        start addr of BASIC pgm in RAM
pend   fdb    $3870        end addr of BASIC pgm in RAM

patch  clr    $ffd9        hi speed
        jmp    start

        org    $c0e0
start  pshs   a,b,x,y
        orcc   #$50         disable ints
        clr    $71
        ldx    pstrt        get starting RAM addr of pgm
        ldy    #$c8c0       get starting EPROM addr
st1    lda    ,y+
        sta    ,x+          copy pgm to RAM
        cmpx   pend         done yet?
        bls    st1          nope
        ldd    pstrt
        addd   #$01
        std    $19          set BASIC pointers
        ldd    pend
        std    $1b
        std    $1d
        std    $1f
        addd   #$02
        std    $11
* ON BRK GOTO should jump here to re-initialize program ($C10C)
obg    clr    $15a        CoCo 3 inits
        lda    #$34
        sta    $ffa0
        ldd    #$ffff
        std    <$0
        lda    #$38
        sta    $ffa0
        puls   a,b,x,y
        andcc  #$af        enable ints
        jsr    $e019
        jsr    $b95c
        ldd    #$adc0      this is not really needed
        std    ,s
        ldx    pstrt
        jmp    $ada7




On 8/7/2017 3:34 PM, John W. Linville wrote:
> Yes, you could stash ML code in the ROM as well. Many things are
> possible, with some changes to the loader required in some cases.
>
> John
>
> On Mon, Aug 07, 2017 at 10:05:04AM -0500, David Ladd wrote:
>> John,
>>
>> Thank you for letting us know.  This will be very useful. :D
>>
>> It should be possible to put your basic program & any ML sub routines into
>> the ROM space yes?
>>
>> +-----------------------------------------------------------------------+
>> | David Ladd a.k.a. PacoOtaktay a.k.a. Drencor                          |
>> | YouTube: http://www.youtube.com/user/PacoOtaktay                      |
>> | YouTube Gaming Live: https://gaming.youtube.com/user/PacoOtaktay/live |
>> | Websites: http://dwladd.com     &     http://www.theterrorzone.com    |
>> | G+:  https://plus.google.com/113262444659438038657                    |
>> | G+:  https://plus.google.com/+DavidLaddPacoOtaktay                    |
>> |                                                                       |
>> | Do you have your CoCo 3 yet?                                          |
>> +-----------------------------------------------------------------------+
>>
>>
>> On Mon, Aug 7, 2017 at 9:51 AM, John W. Linville <linville at tuxdriver.com>
>> wrote:
>>
>>> One of the objections some people have had to distributing their
>>> programs in cartridge form has been that their programs were written
>>> in BASIC. With the help of some ancient knowledge from the Internet
>>> (aka an old Geocities page from "PaulD"), some more recent advice
>>> from Robert Gault, and my own experimentation, I have documented on
>>> the Retro Tinker blog a means of loading Color BASIC (and Extended
>>> Color BASIC) programs from a ROM cartridge:
>>>
>>> http://retrotinker.blogspot.com/2017/08/color-basic-
>>> program-on-cartridge.html
>>>
>>> The technique (including the Errata changes described in the comments)
>>> seems to be working for me. Elsewhere Barry Nelson pointed-out that
>>> the technique doesn't work with CoCo3 "Super Extended Color BASIC"
>>> programs. I did a bit more experimentation and I think I have that
>>> working as well -- but that will have to wait for the next blog
>>> post... ;-)
>>>
>>> Enjoy!
>>>
>>> John
>>> --
>>> John W. Linville                Someday the world will need a hero, and you
>>> linville at tuxdriver.com                  might be all we have.  Be ready.
>>>
>>> --
>>> Coco mailing list
>>> Coco at maltedmedia.com
>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>
>> -- 
>> Coco mailing list
>> Coco at maltedmedia.com
>> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list