ack/mach/i80/libem/rst.s
David Given 360e1525ae Replace the non-working Z80 style signed comparison sign adjustment with
something which actually works on the 8080. Sadly, Star Trek is up to
40243 bytes again.
2019-02-12 11:57:37 +01:00

73 lines
784 B
ArmAsm

#
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.define .rst_init
.rst_init:
mvi a, 0xc3 ! jmp <a16>
sta 0x08
sta 0x10
sta 0x18
lxi h, rst1
shld 0x09
lxi h, rst2
shld 0x11
lxi h, rst3
shld 0x19
ret
! de = [bc+const1] (remember bc is the frame pointer)
rst1:
pop h
mov a, m
inx h
push h
mov l, a
ral
sbb a
mov h, a
dad b
mov e, m
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
! hl = bc+const1
rst3:
pop h
mov a, m
inx h
push h
mov l, a
ral
sbb a
mov h, a
dad b
ret