1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00
cc65/libsrc/runtime/lsave.s
2017-03-19 20:51:54 +01:00

28 lines
578 B
ArmAsm

;
; Ullrich von Bassewitz, 08.08.1998
; Christian Krueger, 11-Mar-2017, optimization
;
; CC65 runtime: save eax into temp storage/restore eax from temp storage
;
.export saveeax, resteax
.importzp sreg, regsave
saveeax:
sta regsave
stx regsave+1
ldy sreg
sty regsave+2
ldy sreg+1
sty regsave+3
rts
resteax:
lda regsave+3
sta sreg+1
lda regsave+2
sta sreg
ldx regsave+1
lda regsave
rts