.TITLE AUXHLP - Aux Help Facilities .IDENT /1.0/ .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: AUXHLP.MAC ; Author: Robin Miller ; Date: August 10, 1985 ; ; Description: ; ; This module contains the routines to display help for AUX. ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL CLOSE$ ; Local storage: AUXLIB: .ASCII "LB:[1,2]" ; Normal help file location. AUXDEF: .ASCIZ "AUXKEY.PAD" ; Look for file in default UIC. .EVEN .SBTTL SHOCTR - Display the control keys. ;+ ; ; SHOCTR - Display the AUX control keys. ; ; This routine is used to display the AUX control keys. ; ; Inputs: ; None. ; ; Outputs: ; Registers R3 - R5 are preserved. ; ;- SHOCTR::JSR R5,$SAVRG ; Save R3 - R5. CALL OPEPAD ; Open the help file. BCS 100$ ; If CS, file open error. ; A formfeed starts the control keys help page. 10$: CALL GET ; Read the next record. BCS 90$ ; If CS, error or EOF. TST R2 ; Anything in this record ? BEQ 10$ ; If EQ, no (blank). CMPB (R1),#FF ; Start of next help page ? BNE 10$ ; If NE, no. ; Loop reading the help file. MOV #FMTBUF,R0 ; Set output buffer address. CLR R3 ; Initialize output length. 20$: CALL GET ; Read the next record. BCS 90$ ; If CS, error or EOF. CALL CPYBUF ; Copy the record buffer. BR 20$ ; Loop until we're done. 90$: TST R3 ; Partial buffer to write ? BEQ 95$ ; If EQ, no. CALL VTYPE ; Yes, display last buffer. 95$: CLOSE$ O.FDB(R5) ; Close the input file. 100$: JMP REFCMD ; Refresh the command line. .SBTTL SHOPAD - Display the AUX keypad. ;+ ; ; SHOPAD - Display the AUX keypad. ; ; This routine is used to display the AUX keypad diagram. ; ; Inputs: ; None. ; ; Outputs: ; Registers R3 - R5 are preserved. ; ;- SHOPAD::JSR R5,$SAVRG ; Save R3 - R5. CALL OPEPAD ; Open the help file. BCS 100$ ; If CS, file open error. ; Loop reading the input file. MOV #FMTBUF,R0 ; Set output buffer address. CLR R3 ; Initialize output length. 10$: CALL GET ; Read the next record. BCS 90$ ; If CS, error or EOF. TST R2 ; Anything in this record ? BEQ 20$ ; If EQ, no (blank). ; A formfeed terminates the keypad help page. CMPB (R1),#FF ; Start of next help page ? BEQ 90$ ; If EQ, yes (all done). 20$: CALL CPYBUF ; Copy the record buffer. BR 10$ ; Loop until we're done. 90$: TST R3 ; Partial buffer to write ? BEQ 95$ ; If EQ, no. CALL VTYPE ; Yes, display last buffer. 95$: CLOSE$ O.FDB(R5) ; Close the input file. 100$: JMP REFCMD ; Refresh the command line. .SBTTL CPYBUF - Copy the record buffer. ;+ ; ; CPYBUF - Copy the record buffer. ; ; Inputs: ; R0 = The output buffer address. ; R1 = The record buffer address. ; R2 = The record buffer length. ; R3 = The output buffer length. ; ; Outputs: ; All inputs will be modified. ; ;- CPYBUF: CLR R4 ; Presume add carriage control. TST R2 ; Is there anything to copy ? BEQ 20$ ; If EQ, no (end of record). ; ; Cludge: ; If record starts with "escape [" presume cursor positioning ; sequence and don't append carriage control. This is done to ; prevent a after writing each key description. ; CMPB (R1),#ESC ; Is this an escape ? BNE 10$ ; If NE, yes. CMPB 1(R1),#'[ ; Start of escape sequence ? BNE 10$ ; If NE, no. COM R4 ; Flag no carriage control. 10$: MOVB (R1)+,(R0)+ ; Copy the next character. INC R3 ; Adjust the output count. CALL CHKFUL ; Check for output full. DEC R2 ; Adjust the record count. BNE 10$ ; Copy the next character. ; End of the input record, append carriage control. 20$: TST R4 ; Add carriage control ? BNE 100$ ; If NE, no. MOVB #CR,(R0)+ ; Append carriage return MOVB #LF,(R0)+ ; and line feed. ADD #2,R3 ; Adjust the output size. CALL CHKFUL ; Check for output full. 100$: RETURN .SBTTL CHKFUL - Check for output buffer full. ;+ ; ; CHKFUL - Check for output buffer full. ; ; Inputs: ; R0 = The output buffer address (presumes FMTBUF). ; R3 = The output buffer size. ; ; Outputs: ; R0 = Starting buffer address (if buffer written). ; R3 is initialized to zero of buffer was written. ; ;- CHKFUL: CMP R3,# ; Is the output buffer full ? BLE 100$ ; If LE, no (copy next). CALL VTYPE ; Yes, display the buffer. CLR R3 ; Initialize output size. 100$: RETURN .SBTTL OPEPAD - Open the AUX keypad file. ;+ ; ; OPEPAD - Open the AUX keypad file. ; ; This routine is used to open the AUX keypad file. ; ; Inputs: ; None. ; ; Outputs: ; C bit clear/set = success/failure. ; R0 = The FDB address. ; R5 = The file entry address. ; ;- OPEPAD: MOV IENTRY,R5 ; Terminal file entry address. MOV O.FDB(R5),R0 ; Copy the FDB address. MOV #AUXDEF,R1 ; Set the file name address. CALL OPENR ; Open the LUN for read. BCC 100$ ; If CC, success. ; Try to open help file in library account. MOV #AUXLIB,R1 ; Set the file name address. CALL OPENR ; Open the LUN for read. BCC 100$ ; If CC, success. MOV O.FNAM(R5),R0 ; Set address to store name. CALL MOVEC ; Copy the help file name. CALL FILERR ; Report the error message. 100$: RETURN .END