;----------------------------------------------------------------------------- ; ; Program: V C R ; ; Author: Jan H. Belgraver ; Modified from: ; Frank Bosso, Presco Inc., Woodbridge, Con, 06525, U.S.A. ; RSX Multi-Tasker, Sept. 1984, 10-14 ; ; Date: 24-Jun-85 ; ; Version: V1.1 10-Sep-86 ; ; Language: Macro-11 ; ; Call: VCR TTnn: ; ; Calls to: EXIT$S, DIR$, GMCR$, QIOW$S, RPOI$ ; ; Description: VCR parses command line into terminal and the actual command ; to be simulated by that terminal. ; Performs a validity check on terminal syntax and number and, ; finally passes command line and terminal to MCR using the ; RPOI$ directive. ; ; Modified by: Jan H. Belgraver 10-Sep-86 JB01 V1.1 ; Name changed from FRC into VCR (Virtual Command Routine) ; ;----------------------------------------------------------------------------- .TITLE VCR ; JB01 .IDENT /V1.1/ .MCALL RPOI$, GMCR$, EXIT$S, DIR$, QIOW$S GMCR: GMCR$ ; The MCR command line getter RPOI: RPOI$ MCR...,,,5,1,,GMCR+G.MCRB,80.,200,TT,0 VCR:: DIR$ #GMCR ; Fetch command line | JB01 MOVB $DSW, R2 ; Fetch byte count BMI FAIL ; No command given MOV #GMCR+G.MCRB, R1; String address SPACE: DEC R2 ; Remaining number of characters to check BLE FAIL ; Can't find a space CMPB (R1)+, #' ; Is it a space? BNE SPACE ; Not yet CMP (R1)+, #"TT ; Validate terminal syntax BNE FAIL ; Bad start SUB #2, R2 ; Account for "TT" BMI FAIL ; Command too short CLR R5 ; Init the Unit # ; Decode response and send appropriate messages ; via MCR... with the RPOI$ directive. LOOP: MOVB (R1)+, R0 ; Get a character DEC R2 ; Update command line length BLE FAIL ; Input error BIC #^C177, R0 ; Strip parity CMPB R0, #': ; Test terminal syntax BEQ DOIT CMPB #'0, R0 ; Test for numeric 0 BHI FAIL ; Input error CMPB #'7, R0 ; Test for numeric 7 BLO FAIL ; Input error SUB #'0, R0 ; Maake it binary ASL R5 ; ASL R5 ; Make room ASL R5 ; ADD R0, R5 ; Add in new character BR LOOP FAIL: QIOW$S #IO.WAL, #5, #1,,,, <#ERMS1, #ERMS1L> ; Send fail message BR BYBY BADTER: QIOW$S #IO.WAL, #5, #1,,,, <#ERMS2, #ERMS2L> ; Send sorry message BR BYBY DOIT: CMP R5, #0 ; Can't use this terminal BEQ BADTER ; Output message MOVB R5, RPOI+R.POUN ; Set terminal number MOV R2, RPOI+R.POBL ; Set command bytecount MOV R1, RPOI+R.POBF ; Set command address DIR$ #RPOI ; Send command BYBY: QIOW$S #IO.WAL, #5, #1,,,, <#CRLF,#2> ; Send | JB01 EXIT$S .NLIST BEX ERMS1: .ASCII \Can't decode terminal, syntax is "VCR TTnn:'command'"\ ; JB01 ERMS1L = . - ERMS1 ERMS2: .ASCII \Sorry, this terminal is reserved\ ERMS2L = . - ERMS2 CRLF: .BYTE 15, 12 ; JB01 .EVEN .END VCR ; JB01