[Coco] Modifying Level1/coco1 for 6309 native mode
Robert Gault
robert.gault at att.net
Fri Feb 14 11:47:33 EST 2014
Made some progress with a native 6309 code for the coco1. I can now get as far
as a time entry request from setime. The screen waits for a key press and
crashes on the first one.
To get this far, you need to edit rbf.asm looking for all the ,u entries. These
will need to be compared to level2/rbf.asm and all pertinent entries changed to
R$reg,u.
shortly after L02E9 change stx $06,u to stx R$X,u
Seek ldb $0A,y
bitb #$02
beq L037B
lda R$X+1,u $05,u
ldb R$U,u $08,u
subd $0C,y
bne L0376
lda R$X,u $04,u
sbca $0B,y
beq L037F
L0376 lbsr L0D72
bcs L0383
L037B ldd R$X,u $04,u
std $0B,y
L037F ldd R$U,u $08,u
std $0D,y
L0383 rts
L03BA ldu $06,y
ldd R$Y,u $06,u
subd $02,s
std R$Y,u $06,u
bra L040E
L03C4 ldd R$Y,u $06,u
bsr L03CD
bcs L03F1
std R$Y,u $06,u
rts
L0414 ldd R$X,u $04,u
ldx R$Y,u $06,u
WriteLn pshs y
clrb
ldy R$Y,u $06,u
beq L0498
ldx R$X,u $04,u
L0484 leay -$01,y
beq L0498
lda ,x+
cmpa #$0D
bne L0484
tfr y,d
nega
negb
sbca #$00
addd R$Y,u $06,u
std R$Y,u $06,u
L0498 puls y
Write ldd R$Y,u $06,u
GetStat ldb R$B,u $02,u
cmpb #SS.Opt
beq L0543
cmpb #$06
bne L052F
clr R$B,u $02,u
L0529 clra
ldb #$01
lbra L03CD
L052F cmpb #SS.Ready
bne L0536
clr R$B,u $02,u
rts
L0536 cmpb #SS.Size
bne L0544
ldd $0F,y
std R$X,u $04,u
ldd <$11,y
std R$U,u $08,u
L0543 rts
L0544 cmpb #SS.Pos
bne L0551
ldd $0B,y
std R$X,u $04,u
ldd $0D,y
std R$U,u $08,u
Gst5FF rts
L0551 cmpb #SS.FD
bne SSFDInf
lbsr L0CD4
bcs L0543
ldu $06,y
ldd R$Y,u was $06,u
tsta
beq L0564
ldd #$0100
L0564 ldx R$X,u was $04,u
shortly after L05C6
ldx R$X,u was $04,u
shortly after L0604
lda R$X+1,u was $05,u
It is safe to say that there will be more level1 code which was disassembled
without conversion to the R$reg format. When going from 6809 to native 6309
code, the register stack changes and all $nm,u type code referring to registers
can fail.
Robert
More information about the Coco
mailing list