.TITLE VTLTWO - Two File Support .IDENT /1.1/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: VTLTWO.MAC ; Author: Robin Miller ; Date: August 10, 30, 1983 ; ; Description: ; ; This module contains the routines used to display two input files. ; ; Modification History: ; ; June 14, 1984 by Robin Miller. Edit (01), Version 1.1 ; Ignore the error return from the GETCMD routine so CTRL/C and ; CTRL/U are handled properly. ; ;- .ENABL AMA .NLIST BEX ; Local messages: FILEM: .ASCIZ "File(s): " .EVEN .SBTTL SPLCMD - Enter split screen mode. ;+ ; ; SPLCMD - Enter split screen mode. ; ; This routine is used to enter the split screen mode so two files can ; be displayed at the same time. ; ; Format: ; SPLIT ! Prompt user for input file(s). ; SPLIT file_spec ! Parse and open the file specification. ; ; Inputs: ; R3 = The remaining string byte count. ; R4 = The string buffer address. ; ; Outputs: ; All registers are preserved. ; ;- .ENABL LSB SPLCMD::BIT #B.2FIL,STATUS ; Are we already in split screen ? BNE 80$ ; If NE, yes (tell the user). TST R3 ; Is there a file specification ? BEQ SPLPR ; If EQ, no (prompt for one). MOV #CMDBUF,R0 ; Store file name in command buffer. MOV R0,R1 ; Copy the buffer address. 10$: MOVB (R4)+,(R1)+ ; Copy the search string. SOB R3,10$ ; Loop until done. CLRB (R1) ; Make sure we have a terminator. BR SPLOPE ; Now, parse and open the file. SPLPR: MOV #FILEM,R1 ; Set address of the prompt string. CALL WRTPRL ; Write the prompt to the terminal. MOV #CMDBUF,R0 ; Set the input buffer address. MOV #CMDSIZ,R1 ; Set the maxiumum byte count. CALL GETCMD ; Request the search string. ;(01) BCS 100$ ; If CS, error or time to exit. TST R1 ; Did the user input anything ? BEQ 90$ ; If EQ, no. ; Inputs: R0 = The input buffer address (terminated by null). SPLOPE: CALL SWAPEM ; Swap the file entrys around. CALL GETLEN ; Get the input buffer length. CALL DOOPEN ; Do the parse and file open. BCC 30$ ; If CC, a file was opened. CALL SWAPEM ; Swap back to the original entry. BR SPLPR ; And prompt for file again. 30$: CALL DOINIT ; Do the initial file setup. BIS #B.2FIL,STATUS ; Show two files are now active. JMP ADJTOP ; Adjust the top and refresh screen. 80$: ERRMSG SPLITM, 90$: BIS #B.DOPR,STATUS ; Nope, show we should reprompt. 100$: RETURN .DSABL LSB .SBTTL ADJTOP - Adjust the top file entry. ;+ ; ; ADJTOP - Adjust the top file entry. ; ; This routine is called to adjust the line counts for the top file ; table entry when either starting the two file display or when we ; are finished with the two file display. ; ; Inputs: ; None. ; ; Outputs: ; Registers R0-R2 are destroyed, all others preserved. ; ;- ADJTOP::MOV IENTRY,R0 ; Copy the file entry address. BIT #B.2FIL,STATUS ; Are we displaying two files ? BNE 10$ ; If NE, yes. ; IENTRY must equal top file at this point. MOV O.DBOT(R0),O.BOT(R0) ; Reset the bottom line number. MOV O.DTOP(R0),O.TOP(R0) ; Reset the top line number. INC O.RLIN(R0) ; Make the ruler the next line. BIT #S.NAME,(R0) ; Is file name display disabled ? BNE 100$ ; If NE, no (we're done). MOV O.FLIN(R0),O.TOP(R0) ; Start display at file name line. BR 100$ ; And use common code. ; IENTRY = The bottom file, AENTRY = The top file. 10$: MOV AENTRY,R1 ; Copy the top file entry address. MOV O.FLIN(R0),R2 ; Copy bottom file line number. DEC R2 ; Make bottom line of top file. MOV R2,O.BOT(R1) ; Setup the number bottom line. MOV O.RLIN(R1),O.TOP(R1) ; Ruler line is top display line. MOV O.FLIN(R1),O.RLIN(R1) ; File line is now the ruler line. 100$: JMP REFCMD ; And refresh both file entrys. .SBTTL SWACMD - Swap to the other file. ;+ ; ; SWACMD - Swap to the other file. ; ; This routine is used to swap back and forth between to files being ; displayed. ; ; Inputs: ; None. ; ; Outputs: ; All registers except R0-R2 are preserved. ; ;- SWACMD::BIT #B.2FIL,STATUS ; Are we displaying two files ? BEQ 100$ ; If EQ, no (ignore the command). CALL CLRACT ; Clear the active message. CALL SWAPEM ; Yes, swap the file entrys. CALL WRTACT ; Write the active message. CALL WRTSCR ; Write the new scroll region. 100$: RETURN .SBTTL SWAPEM - Swap the file entrys. ;+ ; ; SWAPEM - Swap the file entrys. ; ; This routine simply swaps the two input file entrys around. ; ;- SWAPEM::MOV IENTRY,-(SP) ; Save the current file entry. MOV AENTRY,IENTRY ; Set the alternate file entry. MOV (SP)+,AENTRY ; Save the previous file entry. RETURN .END