File comparitor
I thought Taper might do it but its not quite what I was after. Unless I misunderstood that shows if tapes are identical or not but not the differences.
Lets say I have two blocks of code, can be either straightforward tape images of a block or maybe even binary files.
What (Windows I'd guess) program can I use to compare them and list all the differences please ? :)
Lets say I have two blocks of code, can be either straightforward tape images of a block or maybe even binary files.
What (Windows I'd guess) program can I use to compare them and list all the differences please ? :)
Post edited by spider on
Please visit the JetSet Willy & Manic Miner Community
Comments
I think I was sort of after something that would display side by side byte differences with two almost identical blocks of code but that would work otherwise just more work. :)
* Off to download HxD to try later.
10 LET b=last-first+1: FOR a=first TO last: POKE 23618,10: POKE 23620,5+NOT (PEEK a-PEEK (a+b)): PRINT a;" ";PEEK a,a+b;" ";PEEK (a+b): NEXT aEach iteration jumps to statement 5 (PRINT) or 6 (NEXT) depending upon whether corresponding bytes are different or not.I use a similar one called Beyond Compare, which has a hex compare option as well as text compare... although I haven't used it for Speccy programming (mainly because I'm not a Speccy programmer!) (or any sort of programmer really, I'm just a bad haxx0r)
It is now called "Total Commander" because Microsoft complained it was called something with "Windows" :-)
It has the Feature to compare 2 files - and list the differences !
I used HxD and made notes of the difference bytes, then converted them to decimal and finally fired up an emulator to look at the disassembly and compare the differences.
Only 15 bytes are different some grouped some spread around.
I even worked out what some of the changes did although I want to learn so instead of posting a "what does xyz do" I'll see if I can figure some more out myself first. :)
2 LET DOS=32000+11: CLEAR DOS-12: GO SUB 900: LOAD "miniset-LH"CODE VAL "32512+256": LOAD "miniset-RH"CODE VAL "33280+256": CLS : DIM r$(k2,kC): DIM r(k2,k5): INPUT "file#1",r$(k1)'"file#2",r$(k2): LET off=k0 3 FOR i=k1 TO k2: PRINT "Opening ";r$(i): GO SUB FN a("O",r$(i),i+k2,k1,k0,k1): GO SUB FN a("g","",i+k2,k0,k0,k0): LET r(i,k1)=cde: REM get SOF GO SUB FN a("e","",i+k2,k0,k0,k0): LET r(i,k2)=cde: REM get EOF LET r(i,k3)=r(i,k2)-r(i,k1): LET r(i,k4)=134+i-k1: REM size : load point LET r(i,k5)=k32-(k32-r(i,k3) AND r(i,k3) < k32): REM block length NEXT i 11 FOR i=k1 TO k2 12 LET r(i,k5)=k32-(k32-r(i,k3) AND r(i,k3) < k32): IF r(i,k5) THEN GO SUB FN a("R","=r(i,k5)",i+k2,k0,r(i,k4),k0): REM read a block LET r(i,k3)=r(i,k3)-r(i,k5): REM deduct from size 13 NEXT i 14 LET dif=k0: REM check if the blocks differ 15 FOR j=k1 TO k32: FOR i=k1 TO k2: REM pad a short block with spaces 16 IF j > r(i,k5) THEN POKE r(i,k4)*kFG+j-k1,k32: 17 NEXT i: LET dif=[color=green][b]dif+[/b][/color](PEEK (34304+j-k1)<>PEEK (34560+j-k1)): NEXT j 18 PRINT off;AT 24-PEEK 23689,k0;: IF NOT dif THEN GO TO 20: REM no diff = no print 19 PRINT : LET set=+kFG: REM print a block from each file FOR j=34304 TO 34560 STEP kFG: FOR i=k1 TO k32: GO SUB 30: NEXT i: LET set=-set: BRIGHT k1: NEXT j: BRIGHT k0 20 LET off=off+k32: REM loop back if either file is not finished IF r(k1,[color=green][b]k5[/b][/color]) OR r(k2,[color=green][b]k5[/b][/color]) THEN GO TO kB 28 FOR i=k1 TO k2: PRINT "Closing ";r$(i): GO SUB FN a("C","",i+k2,k0,k0,k0): NEXT i 29 GO TO 5260 30 LET ch1=PEEK (j+i-k1): LET ch2=PEEK (j+i-k1+set): REM print a block from each file IF ch1=ch2 THEN PRINT " ";: RETURN: REM if pair matches print space 31 IF ch1>=k32 AND ch1<=k7F THEN PRINT CHR$ ch1;: RETURN: REM if printable char, print 32 LET ch2=FN l(ch1,kG): LET ch1=(ch1-ch2)/kG: REM if non-printable char, print hex byte POKE 23607,127: PRINT CHR$ FN m(ch1);: REM using compressed font POKE 23607,130: PRINT OVER k1;CHR$ k8;CHR$ FN m(ch2);: POKE 23607,60: RETURN : DEF FN m(v)=v+48+(k7 AND v > k9)