79a38ecc08
automatically built helper tools. Star Trek goes up from 40243 to 40779 bytes, but should be a lot faster.
31 lines
526 B
C
31 lines
526 B
C
.sect .text
|
|
.sect .rom
|
|
.sect .data
|
|
.sect .bss
|
|
.sect .text
|
|
|
|
! Fetches the word at positive stack offset OFFSET into de.
|
|
|
|
#define PASTE(a, b) a ## b
|
|
#define LABEL(prefix, offset) PASTE(prefix, offset)
|
|
|
|
.define LABEL(.faddr, OFFSET)
|
|
LABEL(.faddr, OFFSET):
|
|
#if OFFSET == 0
|
|
mov l, c
|
|
mov h, b
|
|
#elif OFFSET == 1
|
|
mov l, c
|
|
mov h, b
|
|
inx h
|
|
#elif OFFSET == 2
|
|
mov l, c
|
|
mov h, b
|
|
inx h
|
|
inx h
|
|
#else
|
|
lxi h, OFFSET
|
|
dad b
|
|
#endif
|
|
ret
|