[Coco] Program to detect a 6309 in a CoCo

Bill Pierce ooogalapasooo at aol.com
Tue Mar 25 22:05:53 EDT 2014


Juan,
 Here's my modified version of the NOS9 code that I use:


CPU rmb 1  results - 0=6809, 1=6309 emu, 2= 6309 native
ENYIRE equ %10000000

cputyp ldd #$ffff make sure D is not clrear
    clr CPU
    fdb $104f clrd in 6309, executes as NOP & CLRA in 6809
    tstb is it 6309?
    bne exit no
is6309 inc CPU
    pshs cc,dp,x,y,u save all except D
    fdb $1038 PSHSW
    leay native,pcr
    leax emulate,pcr
    pshs x,y save them
    pshs cc,a,b,dp,x,y,u
    orcc #ENTIRE
    RTI
emulate leas 2,s
    clrb
    fcb $8c skip 2 bytes
native ldb #1 in native
    puls cc,dp,x,y,u
    tstb are we in native?
    beq exit no
    inc CPU
exit clrb
  rts


You may be able to do something with it.

Bill Pierce
"Today is a good day... I woke up" - Ritchie Havens
 

My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Webmaster of The TRS-80 Color Computer Archive
http://www.colorcomputerarchive.com/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com




-----Original Message-----
From: Juan Castro <jccyc1965 at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Tue, Mar 25, 2014 9:35 pm
Subject: Re: [Coco] Program to detect a 6309 in a CoCo


In the meantime, I did the following:

        ORG $3000
TESTBYTE    FCB    0
START        CLRB
        INCD
        STB    TESTBYTE
        RTS
        END    START

In a 6809, the contents of &H3000 are zero, as they should. I'm hoping the
opcodes $10 $4C (INCD) don't do bad things in a 6809. Do they?



On Tue, Mar 25, 2014 at 10:30 PM, Bill Pierce <ooogalapasooo at aol.com> wrote:

>
> Juan, the NitrOS9 program source for "cputype" is in the Nitros9 repo. You
> could use the technique in that small file to create a basic program to
> poke a small ML program into mem then execute it. A value could be stored
> at a specific address and read from basic once the control returns to basic
> and from that value, the cpu type can be determined. I used something
> similar in os9 to determine cpu type in my programs.
>
>
> Bill Pierce
> "Today is a good day... I woke up" - Ritchie Havens
>
>
> My Music from the Tandy/Radio Shack Color Computer 2 & 3
> https://sites.google.com/site/dabarnstudio/
> Co-Webmaster of The TRS-80 Color Computer Archive
> http://www.colorcomputerarchive.com/
> Co-Contributor, Co-Editor for CocoPedia
> http://www.cocopedia.com/wiki/index.php/Main_Page
> E-Mail: ooogalapasooo at aol.com
>
>
>
>
> -----Original Message-----
> From: Juan Castro <jccyc1965 at gmail.com>
> To: CoCo List <coco at maltedmedia.com>
> Sent: Tue, Mar 25, 2014 9:15 pm
> Subject: [Coco] Program to detect a 6309 in a CoCo
>
>
> I remember seeing, in the list archives, a BASIC program that poked a small
> machine language program to detect whether the CPU is a 6809 or a 6309. The
> person who posted said it was a fix of a previous program that always said
> 6309 even if a 6809 was present.
>
> And I can't find that message anymore! Yes I did try to google it, with
> many many variants. Help?
>
> Juan
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>

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

 



More information about the Coco mailing list