.TITLE CSISW .IDENT /V3.2.1/ ; Provides FORTRAN access to the system command string ; interpreter routines. (See also CSI.MAC and CSISW.MAC) ;+ ; ; CALL CSISW ( STABLE, ISW, IBIT [,NEGFLG] [,VTABLE] ) ;WHERE: ; STABLE - Switch table on first call or offset in ; switch table on subsequent calls. Allow four ; words per entry (one entry per call) plus a ; one word trailer for the whole table. ; ISW - 2 character ASCII switch name. The switch ; table is set up to match any characters after ; the first two, e.g., /LIST will match /LI ; IBIT - Integer bit mask of bit(s) to set in MASK1 upon ; successful parsing of the switch. (see CSI.MAC) ; NEGFLG - ASCII char indicating whether switch negation is allowed: ; '+' -> (default) /-SW or /NOSW not allowed ; '-' -> switch negation allowed ; VTABLE - Switch value table filled in by CSISV (see CSISV.MAC) ; ;- MFSUBR CSISW ;DEFINE FORTRAN ENTRY MFARG 5,<1,2,3>,4,'+ ;1ST 3 ARGS REQUIRED...4TH DEFAULTS POP R0 ; Get switch table address POPARG (R0) ; Load switch characters BIC #100200,(R0)+ ; Clear high sign bit for last char, ; clear low sign bit for noexact match POPARG (R0)+ ; Load mask word CLR (R0)+ ; No optional user mask word CLR (R0) ; No switch value table yet MOVB @(SP)+,R1 ; Get NEGFLG CMPB R1,#'+ ; Negative switch allowed? BEQ 10$ ; No, skip this section CMPB R1,#'- ; Legal syntax? BNE 999$ ; no INC (R0) ; Yes, set neg flag bit 10$: BIS (SP)+,(R0)+ ; "OR" addr of switch value ; table with neg flag CLR (R0) ; Show this is the end of the table RETURN ; Return to caller 999$: TEVARG ;BAD ARGUMENT VALUE .END