.TITLE CONIOS ... consol i/o support module .IDENT /020283/ .ENABL LC ; ; ; ; Written by Ray Di Marco ; 2-Feb-83 ; ; ; Version 020283 ; ; ;------------------------------------------------------------------------ ; ; ; This module contains the CONIO support routines; the routines had to be ; moved to a different module to allow CONIO to be overlayed. The routines in ; this module are ; ; CON$LI returns a line of input from core-common ; CON$EX terminates/exits program ; .SBTTL Documentation - Core Common Usage ; ; This module uses the memory area 500!8 onwards to hold important data ; that must be passed between chained programs. This area is called the core ; common area. This module automatically moves the stack to location 1200!8 ; to increase the amount of memory available to pass data between programs. ; The following memory organization is used ; ; Address Name Function ; 540 CC.FLG Holds ^RCRT if locations 542/544 set up ; 542 CC.TYP Holds ^R CRT type identifier string ; 544 CC.ARG Holds arument needed by TVI driver ; 546 CC.CMD Holds ^RCMD iff core common holds commands ; 550 CC.PNT Points to next command in core common ; 552+ Holds .asciz strings/commands ; ; These locations are reserved for the usage of this module. The 540 to 544 ; locations are used so that the CRT type can be remembered accross chains. ; The 546+ locations are used to allow a MENU program to communicate with its ; CUSPs. This is done by the menu program setting up .ASCIZ strings in ; memory, setting CC.CMD=^RCMD and pointing CC.PNT to the first .ASCIZ string ; prior to chaining to the CUSP. This results in these memory .ASCIZ strings ; being returned to the cusp when CON.LI is called. ; ; If the first byte of a core common string has bit 7 set, it is treated as a ; command to the CON.LI routine. The special commands recognized are ; ; 301 -> no more data in core common ; 302 -> no more data in core common for this program. While ; there may still be more core common commands, these are ; not for this program. ; 303 -> end of core common data for program. The next 8 bytes ; hold the rad50 name of the program to chain to when ; CON.EX is called. ; .SBTTL DECLARATIONS ; ; .MCALL .GTLIN,.PRINT,.TTYOUT,.CHAIN ; RT-11 .MCALL .EXIT,.GVAL,.SERR,.HERR ; RT-11 .MCALL .PUSH,.POP,ABORT ; DBSLIB ; ; .GLOBL CON$LI,CON$EX ; entry points .GLOBL CON.LI,CON.LO,CONVLI ; CONIO ; CC.FLG = 540 ; If = ^RCRT -> type set up CC.TYP = 542 ; holds CRT type ID in ^R CC.ARG = 544 ; used to hold TVI argument CC.CMD = 546 ; If = ^RCMD -> commands in memory CC.PNT = 550 ; points to commands ; ; ; .PSECT CODE ; open code area ; ====== ==== ; ; .SBTTL Routine - "CON$LI" ... input line of text from CC area ; ; The CON.LI entry passes control here iff a core common command sequence is ; active. A core common sequence consists of a series ; of .ASCIZ strings that ; are to be passed back to the caller inplace of tty input. The CC.PNT pointer ; holds the address of the next ; string that must be input. Note that if the ; first byte of a string has bit 7 set, then it is a special control code that ; must be intepreted. Here to return a line of text in buffer @R0. ; CON$LI::TSTB @CC.PNT ; special? BMI 3000$ ; yes -> skip ; ; Return CCM .asciz string. Note that exit via CON.LO to echo input. ; .PUSH ; save MOV @#CC.PNT,R1 ; R1 -> next character to fetch 2100$: MOVB (R1)+,(R0)+ ; copy command BNE 2100$ ; loop MOV R1,@#CC.PNT ; save pointer .POP ; restore JMP CON.LO ; echo input ; ; Must process a special character in core common string. Special codes are ; 301 -> no more core common commands ; 302 -> no more CCC for this program ; 303 -> no more CCC, chain data following ; 3000$: .PUSH R1 ; save MOVB @CC.PNT,R1 ; R1 = special character CMPB R1,#'A+200 ; valid CCC character? BLO 3070$ ; no -> abort BIC #^C77,R1 ; R1 = index number to base 1 DEC R1 ; R1 = index to base 0 CMP R1,#<3070$-3060$>/2 ; valid index? BHI 3070$ ; no -> abort ASL R1 ; R1 = offset JMP @3060$(R1) ; pass over control 3060$: .WORD 3100$,3101$,3102$ ; [EOC] [TTY] [CHN] ; 3070$: ABORT 3100$: CLR @#CC.CMD ; indicate no more commands 3101$: INC @#CC.PNT ; skip character 3102$: MOV 7000$+0,@#CON.LI ; no --> disable **** MOV 7000$+2,@#CON.LI+2 ; call to GTLIN **** .POP R1 ; restore R1 JMP @#CON.LI ; get TTY input 7000$: JMP @.+ ; replaces CALL CON$LI .SBTTL Special Entry - "CON$EX" ... Exit program ; ; The user program wishs to exit. If CC.PNT points to a byte ; holding data 303!8, then wish to perform a chain to program ; whose RAD50 name is in following bytes. ; CON$EX:: ; Entry point to exit MOV @#CC.PNT,R0 ; R0 -> CCM MOVB (R0)+,R1 ; R1 = special character CMPB R1,#303 ; chain time? BEQ 3200$ ; yes -> skip 3100$: .EXIT ; no -> exit ; 3200$: MOV #500,R1 ; R1 -> Chain area MOV #10,R2 ; R2 = number bytes in name 3210$: MOVB (R0)+,(R1)+ ; copy SOB R2,3210$ ; loop MOV R0,@#CC.PNT ; save pointer .CHAIN ; chain time ; ; .END