The mnv and mvp instructions take a source and destination bank numbers, so it's a 3-byte instruction, so naively, you might code it
Code: Select all
mvn 1,4
However this won't work as the assemblers (at least ca65, and I think some others) want the full 24-bit address, even though they strip off the bottom 16 bits, so this ought to be:
Code: Select all
mvn $01000000,$04000000
Code: Select all
; bmn
; Block move macro
.macro bmn len,from,to
lda #len-1
ldx #(from & $FFFF)
ldy #(to & $FFFF)
mvn (from & $FF0000),(to & $FF0000)
.endmacro
Anyway. might help someone wondering why random RAM appears to be clobbered..
It's also a shame in a way that the from & to banks can't be easily changed dynamically without self modifying code. (No change from the PDP-8 there, then
-Gordon