Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; This program swaps the first element of an array of byte-length data with the last
- ; element, the 2nd element with 2nd to last, and so on.
- data equ $1000
- prog equ $2000
- org data
- L dc.b $05
- array db 1,2,3,4,5
- org prog
- ldb L
- ldx #$0002
- idiv
- pshx
- puld
- exg A,B
- ldy #$1000
- ldb L
- aby
- ldx #array
- loop tsta
- beq done
- movb 0,Y,0,SP
- movb 0,X,1,Y-
- movb 0,SP,1,X+
- deca
- bne loop
- done swi
- end
Add Comment
Please, Sign In to add comment