home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_13_1986_Transactor_Publishing.d64
/
move.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
33 lines
900 sys 700 ;activate pal 64 assembler
1000 *=828
1010 ;
1020 srce =25 ;parameter - location of srce address
1030 dest =27 ;parameter - location of dest address
1040 nbytes =29 ;parameter - location of number of bytes
1050 ;
1060 nblks =nbytes+1 ;number of full blocks to move
1070 ;
1080 move lda nblks ;get number of full blocks to move
1090 beq donebl ;if none then test for partial block
1100 lda #0 ;set comparison value for transfer
1110 start sta remain ;256 byte blocks (0=256)
1120 ldy #0 ;set index to point to first byte of block
1130 ;
1140 nxtbyt lda (srce),y ;get next source byte
1150 sta (dest),y ;store at next destination slot
1160 iny ;set index to point to next byte
1170 cpy remain ;compare to remaining bytes value
1180 bne nxtbyt ;if not all moved then do next byte
1190 ;
1200 inc srce+1 ;increment srce address by one block
1210 inc dest+1 ;increment dest address by one block
1220 dec nblks ;decrement number of full blocks to move
1230 bmi done ;if minus then we are done all bytes
1240 bne nxtbyt ;if positive we have more blocks to do
1250 ;
1260 donebl lda nbytes ;do we have a partial block
1270 bne start ;if yes then move it
1280 done rts ;return to calling routine
1290 ;
1300 remain *=*+1 ;number of bytes to move in current block