home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_18_1987_Transactor_Publishing.d64
/
compare
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
3KB
|
102 lines
10 poke56,64:clr:co=06:cr=02:cb=1:poke646,co:poke53280,cr:poke53281,cb
20 if peek(26636)=51 and peek(26638)=52 then100
30 gosub940:print"[211][212][193][206][196][194][217] - [204]oading [205][204] [211]ubroutines. "
40 dn%=peek(186):load"cmp.ml.6800",dn%,1
100 hd$="* [198]ile [195]omparison [213]tility [214]3.4 *"
110 bx$="**********************************"
120 rem of$=chr$(160):nf$=chr$(176)
130 mm%=0:rc%=0:cr$=chr$(13):ze$=chr$(0):fori=1to16:sp$=sp$+chr$(160):next
140 ov$="":ot$="":oz$="":os$="":ob%=0:oy%=0
150 nv$="":nt$="":nz$="":ns$="":nb%=0:ny%=0
160 :
170 gosub940
180 dn%=0:input"[196]isk unit nr (8-11)";dn%:if dn%=0 then end
190 if dn%<8 or dn%>11 then print"[213]nit nr must be 8-11":goto180
200 gosub940:ol$="":input"[207][204][196] file name or $[146]";ol$
210 if ol$="$" then gosub970:goto200
220 if ol$="" then170
230 nu$="":input"[206][197][215] file name or *[146]";nu$
240 if nu$="$" then gosub970:gosub940:goto200
250 if nu$="" then200
260 pd$="":input"[210]eport to s[146]creen or p[146]rinter";pd$
270 if pd$="" then230
280 if pd$="s" then pn%=3:pc%=0:goto310
290 if pd$="p" then pn%=4:pc%=7:goto310
300 goto260
310 :
320 :rem--- get file type, trk, sector
330 oo$=left$(ol$+sp$,16)
340 nn$=left$(nu$+sp$,16)
350 sys26627:if nu$="*" then ny%=1:nb%=0
360 if rc%<128 then400
370 if rc%<255 then a$="failed.":goto390
380 a$="cancelled."
390 print"[196]irectory search ";a$:goto440
400 if oy%<>0 and ny%<>0 then480
410 if oy%=0 then print"[207][204][196] file not found."
420 if ny%=0 then print"[206][197][215] file not found."
430 print"[197]nter $[146] to list the disk directory."
440 print"[208]ress any key to continue"
450 get a$:if a$="" then450
460 goto200
470 :
480 :rem--- get report and record type
490 os$=ze$:print"[195]hoose a[146]scii";
500 if oy%=2 then print",b[146]asic,d[146]isassembly";
510 ov$="":input",hex[146]";ov$
520 if ov$="a" or ov$="x" then580
530 if oy%=2 and ov$="b" then ot$="c":oz$=chr$(0):goto820
540 if oy%=2 and ov$="d" then ot$="f":oz$=chr$(1):goto820
550 if ov$="" then goto820
560 goto490
570 :rem--- record specification
580 ot$="":input"[201]s record length f[146]ixed or v[146]ariable";ot$
590 if ot$="f" then630
600 if ot$="v" then660
610 if ot$="" then490
620 goto580
630 x=0:input"[211]pecify record length (1-255)";x:if x<1 or x>255 then580
640 oz$=chr$(x):goto820
650 :rem--- variable ln record
660 print"[195]hoose end of record indicator..."
670 ot$="":input" c[146]haracter, l[146]ength, or m[146]ask";ot$
680 if ot$="c" then a$="character":goto730
690 if ot$="m" then a$="mask":goto730
700 if ot$="l" then790
710 if ot$="" then580
720 goto660
730 x$="":print"[197]nter value of ";a$;" (0-255)";:input x$:if x$="" then660
740 x=val(x$):if x<0 or x>255 then730
750 oz$=chr$(x)
760 x$="":input "[197]nter minimum record length (0-255)";x$:if x$="" then730
770 x=val(x$):if x<0 or x>255 then760
780 os$=chr$(x):goto820
790 x$="":input "[211]pecify the location (1-255)";x$:if x$="" then760
800 x=val(x$):if x<1 or x>255 then790
810 oz$=chr$(x)
820 if ov$="" then260
830 nv$=ov$:nt$=ot$:nz$=oz$:ns$=os$
840 :
850 :rem--- produce comparison report
860 a$=chr$(147):b$=" ":if pn%<>3 then a$=chr$(12):b$=" "
870 open pn%,pn%,pc%
880 print#pn%,a$;b$;bx$;cr$;b$;hd$;cr$;b$;bx$;cr$
890 print#pn%,b$;"[207][204][196] [206]ame: ";ol$
900 print#pn%,b$;"[206][197][215] [206]ame: ";nu$;cr$
910 sys26624:gosub990:goto200
920 :
930 :--- display screen header
940 print"[147]"chr$(14)tab(3)hd$cr$cr$:return
950 :
960 :--- list directory
970 pn%=3:nu$="*":open pn%,pn%,pc%:sys26630
980 :
990 a$="[195]ompare ":if nu$="*" then a$="[204]isting "
1000 b$="finished.":if rc%>99 then b$="failed.":if rc%=255 then b$="cancelled."
1010 if nu$<>"*" then b$=b$+str$(mm%)+" mismatches."
1020 print#pn%,cr$cr$a$b$:print#pn%:close pn%
1030 if pn%<>3 then1060
1040 print"[208]ress any key to continue."
1050 get a$:if a$="" or a$=chr$(136) then1050
1060 return