[Coco] [Color Computer] Color Computer 68b03 test

Robert Gault robert.gault at worldnet.att.net
Fri Jul 25 00:31:39 EDT 2008


chargeron wrote:
> Does anyone have a basic program that will test if a hitachi chip is present???
> 
> thanks
> Ron Delvaux

Strictly speaking, it is not possible to determine whether a Coco's CPU 
is an MC6809 or an H6309 with anything other than an ml program. 
However, it is possible to use Basic to POKE a machine language program 
into memory, run it, and report the results.

What is needed is an ml program that uses an opcode which give different 
results for a 6809 and 6309. As an example, COMD is a 6309 opcode which 
is $1043. For a 6809, this is an illegal instruction so the $10 is 
skipped over and $43 is used which is the opcode COMA.
The following Basic program generates an ml program that tries to do a
  LDD $FFFF
  COMD
  STD TEMP
which only works with a 6309.

10 REM CPUTEST
20 CLEAR256,&H7000
30 LI=80
40 FOR M=&H7000 TO &H7008 STEP10:SUM=0
50 FOR I=0TO9:READA$:VA=VAL("&H"+A$):SUM=SUM+VA:POKE M+I,VA:NEXT:READ 
CHK:IFSUM<>CHK THEN PRINT"ERROR IN LINE"LI:END
60 LI=LI+10:NEXT
70 EXEC&H7000
80 PRINT"YOUR CPU IS A";
90 IFPEEK(&H7021)=0 THENPRINT" 6309"ELSE PRINT" 6809"
100 END
110 DATA CC, FF, FF, 10, 43, FD, 70, 20, 39, 00, 1251

50 is one long line but may not appear that way via e-mail.



More information about the Coco mailing list