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:
mvi a, 0xc3 ! jmp <a16>
sta 0x08
sta 0x10
lxi h, rst1
shld 0x09
lxi h, rst2
shld 0x11
ret
! de = [bc+const1] (remember bc is the frame pointer)
@ -30,3 +33,22 @@ rst1:
inx h
mov d, m
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
pat lol sfit($1, 8)
kills hlreg
uses hlreg, dereg
uses hlreg, areg, dereg
gen
rst {const1, 1}
data1 {const1, $1}
@ -463,7 +462,7 @@ with dereg yields de de leaving stl $1
#ifdef USE_I80_RSTS
pat stl sfit($1, 8)
with dereg
kills hlreg, areg
uses hlreg, areg
gen
rst {const1, 2}
data1 {const1, $1}