; ; SEARCH ; This macro is an aid for recognizing digits; it can be used to ; recognize a numeric constant in a LET statement. If CHAR is a digit ; or a -, POS_C will have a value other than 11. ; .macro search char pos_c = %locate(char,<-0123456789>) .endm search ; ; INTEGER ; Defines storage for a longword integer variables; also defines two ; symbols, one for the length of each variable and the other for the ; type of each variable. ; .macro integer arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 .irp name, .if not_blank name name: .blkl 1 name'_s=4 name'_t=1 .endc .endr .endm integer ; ; CHARACTER ; Defines storage for a character string variables; also defines two ; symbols, one for the length of each variable and the other for the ; type of each variable. ; .macro character arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 .irp name, .if not_blank name ast_c=%locate(<*>,name) dig_c=ast_c+1 nl_c=%length(name) dig_l=nl_c-dig_c %extract(0,ast_c,name): .blkb %extract(dig_c,dig_l,name) %extract(0,ast_c,name)_s=%extract(dig_c,dig_l,name) %extract(0,ast_c,name)_t=2 .endc .endr .endm character ; ; OPEN ; This macro performs an OPEN on the specified file (FSPEC) for the ; purpose specified in USE and associates the ID with the file. The ; ID is used to name the $FAB and $RAB areas as DCB'ID and DREC'ID ; respectively. The RSIZE is the record size for the file and is used ; to control the buffer size and in $RAB specifications. ; The FOR, AS, FILE, WITH, and REC arguments are not used. ; .macro open fspec for use as file id with rec rsize dir_c=%locate(use,) x_l_c = x_l_c + 1 ; Generate a unique label for BRW brw s'id%extract(x_l_c,1,) .if not_defined dcb'id .align long .noshow meb .if eq dir_c ; For INPUT, set up $FAB, $RAB dcb'id: $fab drec'id: $rab fab=dcb'id, ubf=buf'id, usz=rsize .if_false ; For OUTPUT, set up $FAB, $RAB dcb'id: $fab rat=cr, mrs=rsize drec'id: $rab fab=dcb'id, rbf=buf'id, rsz=rsize .endc .show meb buf'id: .blkb rsize ; Buffer size fn'id: .ascii /fspec/ ; Name of file to open .endc s'id%extract(x_l_c,1,): movab fn'id, dcb'id+fab$l_fna movb #%length(fspec), dcb'id+fab$b_fns .if eq dir_c $open fab=dcb'id ; For a file that exists .if_false $create fab=dcb'id ; To make a new file .endc $connect rab=drec'id .endm open ; ; GO ; Does an unconditional branch to specified DEST using word displacement. ; The TO argument is not used. ; .macro go to dest brw dest .endm go ; ; CLOSE ; Close a file that is open. The file is referred to by its ID ; .macro close id $close fab=dcb'id .endm close ; ; PROGRAM ; Specify the title for the program; set the PSECT and assign ; X_L_C an initial value. X_L_C is used to generate labels in OPEN ; .macro program arg1 arg2 arg3 arg4 arg5 .show meb .title arg1 arg2 arg3 arg4 arg5 .psect basic, long x_l_c = -1 .endm program ; ; BEGIN ; Start the instructions portion of the program. ; .macro begin .entry start,^m<> .endm begin ; ; END ; Exit from the program and mark the bottom with a .end ; .macro end $exit_s %extract(0,4,<.end>) start .endm end ; ; REM ; Generate comments/remarks. They may say anything using up to 14 ; words per line. ; .macro rem a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 ; a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 .endm rem