;***************************************************************************;
; ;
; ;
; VUECOM ;
; VUE-like File Compare ;
; ;
; ;
;***************************************************************************;
;1.0 01-Nov-84 DFP written by D. Pallmann.
;
;1.1 04/11/86 - D. Eichbauer - MBS Data Systems - Merrill, MI
; Corrected invalid filespec error when filenames separated
; by commas (as per help message).
; Forced cursor to line 24 at exit after display.
; Modified the reverse count so that pages backward same
; number of lines as forward.
; Prevented display past end of file.
; Added Home Key processing.
; Added ^E (Bottom of File) processing.
; Corrected line counting errors for files > 80 characters long.
; Corrected display at file switch so that it starts at
; beginning of line (backs up to first character in line if
; necessary).
; Still needs removal of slop in positioning.
VMAJOR=1
VMINOR=1.
SEARCH SYS
SEARCH SYSSYM
SEARCH TRM
SEARCH CRT
IMP=A5
TAB=11
LF=12
CR=15
ESC=33
.OFINI
.OFDEF FILE1,D.DDB ;DDB for 1st file
.OFDEF FILE2,D.DDB ;DDB for 2nd file
.OFDEF BASE1,4 ;base of 1st file
.OFDEF BASE2,4 ;base of 2nd file
.OFDEF SIZE1,4 ; SIZE OF FIRST FILE [1.1]
.OFDEF SIZE2,4 ; SIZE OF SECOND FILE [1.1]
.OFSIZ IMPSIZ
START: PHDR -1,0,PH$REE!PH$REU ;program header
GETIMP IMPSIZ,IMP ;allocate impure area
JMPTBL: WORD DOWN-JMPTBL
WORD UP-JMPTBL
WORD BACK-JMPTBL
WORD FWD-JMPTBL
WORD HOME-JMPTBL ; [1.1]
WORD BOTTOM-JMPTBL ; [1.1]
WORD SWITCH-JMPTBL
WORD EXIT.1-JMPTBL
PAGE
SWITCH: CMM BASE1(IMP),A4
BEQ 10$
MOV BASE1(IMP),A4
MOV SIZE1(IMP),D4 ; [1.1]
CRT #2,#1
BR 20$ ; [1.1]
10$: MOV BASE2(IMP),A4
MOV SIZE2(IMP),D4 ; [1.1]
CRT #13.,#1
20$: CMP D4,D5 ; Make sure not past end. [1.1]
JLE BOTTOM ; [1.1]
24$: TST D5 ; See if at top. [1.1]
BEQ 30$ ; [1.1]
CMPB -1(A4)[D5],#LF ; See if at beginning of line. [1.1]
BEQ 30$ ; [1.1]
DEC D5 ; [1.1]
BR 24$ ; [1.1]
30$: CALL DISPLAY ; [1.1]
JMP READY
EOF: CMM BASE1(IMP),A4 ; See if on file 1 or 2. [1.1]
BNE 2$ ; If 2, go around. [1.1]
CRT #2,#1 ; Position cursor for file 1. [1.1]
BR 4$ ; [1.1]
2$: CRT #13.,#1 ; Position cursor for file 2. [1.1]
4$: HIGH ; [1.1]
MOV #CR,D1 ; Get back to beginning of line. [1.1]
TTY ; [1.1]
MOV D4,D5 ; Point to bottom of file. [1.1]
TST D5 ; Make sure not 0 length. [1.1]
BLE 56$ ; If so, all done. [1.1]
MOV A4,A0 ; Point to top of file. [1.1]
ADD D5,A0 ; Add the offset. [1.1]
MOV #11.,D0 ; Look back 10 lines. [1.1]
5$: CLR D3 ; Set up line length counter. [1.1]
10$: INC D3 ; Bump our line length counter [1.1]
CMP D3,#80. ; No more than 80 characters per line. [1.1]
BGT 15$ ; If we exceeded length, same as LF. [1.1]
DEC D5 ; Decrement the offset. [1.1]
BEQ 30$ ; Don't go back past top of file. [1.1]
CMPB -(A0),#LF ; See if at beginning of line. [1.1]
BNE 10$ ; If not, keep going backwards. [1.1]
15$: SOB D0,5$ ; Else loop for another line until 10 found. [1.1]
20$: INC D5 ; Adjust for one too many. [1.1]
30$: MOV D4,D3 ; Get our total file length. [1.1]
SUB D5,D3 ; And now our total display length. [1.1]
MOV A4,A0 ; Point to top of file again. [1.1]
ADD D5,A0 ; Add the offset for start. [1.1]
MOV #10.,D0 ; Display 10 lines at most. [1.1]
40$: CLR D2 ; Set up our line length counter. [1.1]
42$: CTRLC EXIT.1 ; Bomb out of program on control-c. [1.1]
MOVB (A0)+,D1 ; Get the next character. [1.1]
DEC D3 ; Make sure not past end of file. [1.1]
BLT EOF.1 ; If so, short file, so just clear rest. [1.1]
CMPB D1,#CR ; If CR, then we clear rest of line. [1.1]
BNE 50$ ; [1.1]
SAVE D1 ; [1.1]
CLREOL ; [1.1]
REST D1 ; [1.1]
50$: TTY ; Output the current character. [1.1]
INC D2 ; Bump our line counter. [1.1]
CMPB D1,#LF ; See if at end of line. [1.1]
BNE 60$ ; If not, continue. [1.1]
54$: SOB D0,40$ ; Else loop back for more lines if there. [1.1]
56$: CLR D3 ; [1.1]
CALL POSIT ; [1.1]
RTN ; [1.1]
60$: CMPB D1,#CR ; [1.1]
BEQ 40$ ; [1.1]
CMPB D2,#80. ; See if 80 characters on this line. [1.1]
BEQ 54$ ; If so, treat same as LF. [1.1]
BR 42$ ; Else just continue on. [1.1]
EOF.1: CLREOL ; If short file, then blank lines. [1.1]
TYPECR ; [1.1]
SOB D0,EOF.1 ; Till ten lines on screen. [1.1]
CLR D3 ; [1.1]
CALL POSIT ; [1.1]
RTN ; [1.1]
POSIT:
LOW ; [1.1]
CMM BASE1(IMP),A4 ; See if on file 1 or 2. [1.1]
BNE 20$ ; If 2, go around. [1.1]
CRT #1.,#37. ; Position cursor for file 1. [1.1]
MOV D5,D1 ; [1.1]
BNE 2$ ; [1.1]
TTYL TOF ; [1.1]
BR 3$ ; [1.1]
2$: DCVT 7,OT$TRM!OT$ZER!OT$TSP ; [1.1]
3$: CRT #1.,#55. ; [1.1]
TST D3 ; [1.1]
BGT 4$ ; [1.1]
TTYL BOT ; [1.1]
RTN ; [1.1]
4$: MOV A0,D1 ; Get last character position [1.1]
SUB A4,D1 ; And calculate length. [1.1]
DEC D1 ; Adjust for offset. [1.1]
DCVT 7,OT$TRM!OT$ZER!OT$TSP ; [1.1]
RTN ; [1.1]
20$: CRT #23.,#37. ; Position cursor for file 2. [1.1]
MOV D5,D1 ; [1.1]
BNE 25$ ; [1.1]
TTYL TOF ; [1.1]
BR 30$ ; [1.1]
25$: DCVT 7,OT$TRM!OT$ZER!OT$TSP ; [1.1]
30$: CRT #23.,#55. ; [1.1]
TST D3 ; [1.1]
BGT 35$ ; [1.1]
TTYL BOT ; [1.1]
RTN ; [1.1]
35$: MOV A0,D1 ; Get last character position [1.1]
SUB A4,D1 ; And calculate length. [1.1]
DEC D1 ; Adjust for offset. [1.1]
DCVT 7,OT$TRM!OT$ZER!OT$TSP ; [1.1]
RTN ; [1.1]
DASHES: ASCIZ /-------------------------------------------------------------------------------/
EVEN
MESAG: ASCIZ /Start Off. End Off. /
EVEN
TOF: ASCIZ /File Top/
EVEN
BOT: ASCIZ /File End/
EVEN