ack/mach/i80/libem/rst.s
David Given 79a38ecc08 Instead of using parameterised rsts for stack access, add a huge swathe of
automatically built helper tools. Star Trek goes up from 40243 to 40779 bytes,
but should be a lot faster.
2019-02-13 22:45:22 +01:00

40 lines
668 B
ArmAsm

#
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! Which resets we install are determined by statistical analysis of Star
! Trek. When changing these, make sure to update the i80 table to match.
! 97 call .floadn2
! 41 call .floadn4
! 34 call .fload4
! 28 call .fstoren2
.define .rst_init
.rst_init:
lxi h, .floadn2
lxi d, 0x0008
call copy
lxi h, .floadn4
lxi d, 0x0010
call copy
lxi h, .fload4
lxi d, 0x0018
call copy
lxi h, .fstoren2
lxi d, 0x0020
jmp copy
! Copies eight bytes from HL to DE.
copy:
mvi c, 8
.1:
mov a, m
stax d
inx h
inx d
dcr c
jnz .1
ret