home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 69
/
069.d81
/
copy.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
1KB
|
46 lines
100 open2,8,1,"0:copy"
110 sys700
120 ;
130 .opt o2
140 ;
150 xsad8a =$ad8a
160 xsaefd =$aefd
170 xsb7f7 =$b7f7
180 ;
190 jsr xsaefd ; fetch comma
200 jsr xsad8a ; get source in fac
210 jsr xsb7f7 ; convert to integer
220 sty $b0 ; ($b0) => source addr
230 sta $b1 ;
240 jsr xsaefd ; fetch comma
250 jsr xsad8a ; get dest in fac
260 jsr xsb7f7 ; convert to integer
270 sty $b2 ; ($b2) => dest addr
280 sta $b3 ;
290 jsr xsaefd ; fetch comma
300 jsr xsad8a ; get byte count in fac
310 jsr xsb7f7 ; convert to integer
320 eor #$ff ; one's comp of msb
330 sta $b5 ; store it away
340 tya ;
350 eor #$ff ; one's comp of lsb
360 sta $b4 ; store it away
370 inc $b4 ; generate two's compl.
380 bne dni ; of the byte count
390 inc $b5 ;
400 ;
410 dni ldy #0 ; init index register
420 j37a3 lda ($b0),y ; fetch a byte
430 sta ($b2),y ; store a byte
440 iny ; update index reg
450 bne dip ;
460 inc $b1 ; update pntr msb's
470 inc $b3 ; only when necessary
480 ;
490 dip inc $b4 ; increment two's comp
500 bne j37a3 ; of the byte count
510 inc $b5 ; loop back while the
520 bne j37a3 ; count is negative
530 rts ; get back to basic
0