8-Bit Software Online Conversion

*CLONE utility sourcecode - Listing

10DEFFNN="B.Clone" 20src=&8C:dest=&8D 30FORF%=0TO2STEP2 40P%=&900 50[OPTF% 55.clone 60LDY #0:.findparm1 LDA(&F2),Y:INY:CM P#13:BEQhelp:CMP#32:BNE findparm1:BEQ af sp 70.help LDA#text AND&FF:STA src:LDA#t ext DIV256:STA dest:LDY#0:.helploop LDA (src),Y:JSR&FFEE:INY:BNEvdu:INC dest:.vd u CMP#0:BNE helploop:RTS 80.afsp LDA(&F2),Y:CMP#32:BNEskp1:.sk p1lp INY:LDA(&F2),Y:CMP#32:BEQskp1lp:.sk p1 CMP#13:BEQhelp 90LDA#32:LDX#16:.reslop DEX:STAbuffer ,X:BNEreslop:.afsplp LDA(&F2),Y:STAbuffe r,X:INY:INX:CMP#13:BEQ fault:CMP#32:BNE afsplp:BEQ afsp2:.fault BRK:EQUB 128:EQU S "No destination file specified":EQUB 0 100.afsp2 LDA(&F2),Y:CMP#32:BNEskp12:. skp1lp2 INY:LDA(&F2),Y:CMP#32:BEQskp1lp2 :.skp12 CMP#13:BEQ fault 110LDA#32:LDX#16:.reslop2 DEX:STAbuffe r2,X:BNEreslop2:.afsplp2 LDA(&F2),Y:STAb uffer2,X:INY:INX:CMP#13:BEQ end:CMP#32:B NE afsplp2 120.end LDA #32:STA buffer2-1,X 125LDX #15:.compare LDA buffer,X:ORA # 32:STA block:LDA buffer2,X:ORA #32:CMP b lock:BNE unlike:DEX:BPL compare:BRK:EQUB 130:EQUS "Identical afsps":EQUB0:.unlik e 130LDA #buffer MOD256:STA block:LDA #b uffer DIV 256:STA block+1:LDX #block MOD 256:LDY #block DIV256:LDA #5:JSR &FFDD:C MP #0:BNE create:BRK:EQUB 129:EQUS"File not found":EQUB 0 140.create LDX #3:.mloop LDA block+&A, X:STA block+&E,X:LDA #0:STA block+&A,X:D EX:BPL mloop 150LDA #buffer2 MOD256:STA block:LDA # buffer2 DIV 256:STA block+1:LDX #block M OD256:LDY #block DIV256:LDA #0:JSR &FFDD 160LDX #buffer MOD256:LDY #buffer DIV 256:LDA #&40:JSR &FFCE:STA block 170LDX #buffer2 MOD256:LDY #buffer2 DI V 256:LDA #&C0:JSR &FFCE:STA block2 180LDX #9:LDA #0:.zero STA block+3,X:S TA block2+3:DEX:BPL zero 190.copy LDA #sector MOD256:STA block+ 1:LDA #sector DIV256:STA block+2:LDA #&0 1:STA block+6:LDA #3:LDX #block MOD 256: LDY #block DIV 256:JSR &FFD1:BCS eof 192.putthem LDA #sector MOD256:STA blo ck2+1:LDA #sector DIV256:STA block2+2:LD A #&01:STA block2+6:LDA #1:LDX #block2 M OD 256:LDY #block2 DIV 256:JSR &FFD1:JMP copy 194.eof LDA #sector MOD256:STA block2+ 1:LDA #sector DIV256:STA block2+2:LDA #0 :STA block2+6:SEC:SBC block+5:STA block2 +5:LDA #1:LDX #block2 MOD 256:LDY #block 2 DIV 256:JSR &FFD1 200LDA #0:LDY block:JSR &FFCE:LDY bloc k2:JSR &FFCE 210RTS 220.text 230EQUB10:EQUS"DFS file cloning utilit y v1.00 by Lars 0sterballe 1991":EQUW&0A 0D 240EQUB10:EQUS"*CLONE <src afsp> <dest afsp>":EQUW&0A0D:EQUB10 250EQUS"<src afsp> is file to be clone d":EQUW&0A0D 260EQUS"<dest afsp> is the clone file" :EQUW&0A0D 270EQUW &000A 280.buffer EQUS "XXXXXXXXXXXXXXXX":EQU B13 290.buffer2 EQUS "XXXXXXXXXXXXXXXX":EQ UB13 300.block EQUW 0 310EQUD 0 320EQUD 0 330EQUD 0 340EQUD 0 341.block2 EQUW 0 342EQUD 0 343EQUD 0 344EQUD 0 345EQUD 0 350.sector 360] 370NEXT 380OSCLI"*SAVE Clone "+STR$÷clone+" "+ STR$÷P%