1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-31 04:04:49 +00:00
cc65/libsrc/runtime/lsave.s

28 lines
578 B
ArmAsm
Raw Normal View History

;
; Ullrich von Bassewitz, 08.08.1998
2017-03-12 22:21:43 +00:00
; Christian Krueger, 11-Mar-2017, optimization
;
2017-03-19 19:51:54 +00:00
; CC65 runtime: save eax into temp storage/restore eax from temp storage
;
.export saveeax, resteax
.importzp sreg, regsave
saveeax:
sta regsave
stx regsave+1
2017-03-12 22:21:43 +00:00
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