mirror of
https://github.com/cc65/cc65.git
synced 2024-11-18 15:05:14 +00:00
e1385c925a
git-svn-id: svn://svn.cc65.org/cc65/trunk@1629 b7a2c559-68d2-44c3-8de9-860c34a00d81
29 lines
600 B
ArmAsm
29 lines
600 B
ArmAsm
;
|
|
; Ullrich von Bassewitz, 25.11.2002
|
|
;
|
|
; CC65 runtime: Swap x bytes of register variable space
|
|
;
|
|
|
|
.export regswap
|
|
.importzp sp, regbank, tmp1
|
|
|
|
.proc regswap
|
|
|
|
sta tmp1 ; Store count
|
|
@L1: lda regbank,x ; Get old value
|
|
pha ; Save it
|
|
lda (sp),y ; Get stack loc
|
|
sta regbank,x ; Store new value
|
|
pla
|
|
sta (sp),y ; Store old value
|
|
inx
|
|
iny
|
|
dec tmp1
|
|
bne @L1
|
|
|
|
rts
|
|
|
|
.endproc
|
|
|
|
|