.TITLE CSISV .IDENT /V3.2.1/ ; CSISV - Create switch value descriptor table entry. ; ; Provides FORTRAN access to the system command string ; interpreter routines. (See also CSI.MAC and CSISW.MAC.) ;+ ; ; CALL CSISV ( VTABLE, TYPE, VDEST [,LENGTH] ) ;WHERE: ; VTABLE - Switch value table on first call or offset in ; switch value table on subsequent calls. Allow ; two words per entry (one entry per call) plus a ; one word trailer for the entire table. ; TYPE - ASCII character indicating the type of switch value: ; 'A' = ASCII ; 'N' = Numeric (same as OCTAL) ; 'O' = OCTAL ; 'D' = DECIMAL ; VDEST - Variable or array to hold value. Numeric, OCTAL, ; and DECIMAL locations must be of type INTEGER. ; Note that only one value for one switch may be ; specified in each call to CSISV. ; LENGTH - If TYPE = 'A' (ASCII), length, in bytes, of VDEST. ; Else, LENGTH is ignored and the default (2 bytes == 1 word) ; is used. ; ;- MFSUBR CSISV ;DEFINE ENTRY POINT MFARG 4,<1,2,3>,4,2 ;1ST 3 ARGS REQUIRED...4TH DEFAULTS TO 2 POP R1 ; Get addr of switch value table MOVB @(SP)+,R4 ; Get switch type POP R0 ; Get VDEST address MOVB @(SP)+,R5 ; Get LENGTH of VDEST CMPB R4,#'A ; ASCII value? BNE 20$ ; If NE, no MOVB #1,(R1)+ ; Yes, set ASCII flag MOVB R5,(R1)+ ; and maximum string length BR 50$ ; Exit to common code 20$: CMPB R4,#'D ; DECIMAL value? BNE 30$ ; If NE, no MOVB #3,(R1)+ ; Yes, set DECIMAL flag BR 40$ ; and set length to 2 30$: CMPB R4,#'O BEQ 35$ CMPB R4,#'N BNE 999$ ; NOT LEGAL VALUE!! 35$: MOVB #2,(R1)+ ; Must be OCTAL or numeric 40$: MOVB #2,(R1)+ ; and set length to 2 50$: MOV R0,(R1)+ ; Store addr of receiving location CLR (R1) ; Show this is the end of the table RETURN ; Return to caller 999$: TEVARG ;ERROR...BAD ARG VALUE! .END