1
0
mirror of https://github.com/cc65/cc65.git synced 2026-03-11 08:41:58 +00:00
Files
cc65/libsrc/runtime/regswap.s
2025-06-22 21:34:41 +00:00

29 lines
627 B
ArmAsm

;
; Ullrich von Bassewitz, 25.11.2002
;
; CC65 runtime: Swap x bytes of register variable space
;
.export regswap
.importzp c_sp, regbank, tmp1
.proc regswap
sta tmp1 ; Store count
@L1: lda regbank,x ; Get old value
pha ; Save it
lda (c_sp),y ; Get stack loc
sta regbank,x ; Store new value
pla
sta (c_sp),y ; Store old value
inx
iny
dec tmp1
bne @L1
rts
.endproc