Somehow the implementation of rst 2 got lost, with hilarious results. Also fix

some register corruption issues (I hope).
This commit is contained in:
David Given 2019-02-08 21:35:14 +01:00
parent 22032575c5
commit a91ab5c599
2 changed files with 25 additions and 4 deletions

View file

@ -9,8 +9,11 @@
.rst_init: .rst_init:
mvi a, 0xc3 ! jmp <a16> mvi a, 0xc3 ! jmp <a16>
sta 0x08 sta 0x08
sta 0x10
lxi h, rst1 lxi h, rst1
shld 0x09 shld 0x09
lxi h, rst2
shld 0x11
ret ret
! de = [bc+const1] (remember bc is the frame pointer) ! de = [bc+const1] (remember bc is the frame pointer)
@ -30,3 +33,22 @@ rst1:
inx h inx h
mov d, m mov d, m
ret ret
! [bc+const1] = de (remember bc is the frame pointer)
rst2:
pop h
mov a, m
inx h
push h
mov l, a
ral
sbb a
mov h, a
dad b
mov m, e
inx h
mov m, d
ret

View file

@ -245,8 +245,7 @@ pat ldc yields {const2,highw($1)}
#ifdef USE_I80_RSTS #ifdef USE_I80_RSTS
pat lol sfit($1, 8) pat lol sfit($1, 8)
kills hlreg uses hlreg, areg, dereg
uses hlreg, dereg
gen gen
rst {const1, 1} rst {const1, 1}
data1 {const1, $1} data1 {const1, $1}
@ -462,8 +461,8 @@ with dereg yields de de leaving stl $1
#ifdef USE_I80_RSTS #ifdef USE_I80_RSTS
pat stl sfit($1, 8) pat stl sfit($1, 8)
with dereg with dereg
kills hlreg, areg uses hlreg, areg
gen gen
rst {const1, 2} rst {const1, 2}
data1 {const1, $1} data1 {const1, $1}