VOLUME 1 General procedure, macro reference and utility manual INDEX 1 General information PAGE 1 2 CORAL PROCEDURES PAGE 5 3 CORAL Debug and Error procedures. PAGE 29 4 MACRO Routines. PAGE 33 5 CHARACTER/STRING MANIPULATION ROUTINES USING CD.DIC. PAGE 58 6 Node manipulation routines PAGE 68 7 Table manipulation routines PAGE 74 8 Device channel routines PAGE 82 9 Message checking routines. PAGE 87 10 Stand alone Serial device line handler/driver. PAGE 90 11 Stand alone Serial line device handler/driver. PAGE 96 12 MACROS FOR SYSTEM CONFIGURATION AND SERIAL IO DEFINITIONS. PAGE 100 13 SUPER-MAC REFERENCE GUIDE - VERSION 47. PAGE 114 14 DECISION TABLES - REFERENCE GUIDE. PAGE 142 15 STRING HANDLING MACROS. PAGE 160 16 General purpose macros PAGE 170 17 TABLE HANDLING MACROS. PAGE 181 18 Module Reference Tables. PAGE 187 19 Utility program XY Plotter emulator. PAGE 197 20 Utility program Indexer program. PAGE 199 21 Utility program Simple Upper/Lower case EDITOR PAGE 202 22 Utility program Tidy and Document program. PAGE 205 23 GENERAL INFORMATION AND REVISION LIST PAGE 215 CHAPTER 1 General information INDEX 1 Disclamer PAGE 2 2 Introduction PAGE 3 Disclamer PAGE 2 *********************************************************** * * * DIGITAL EQUIPTMENT COMPUTER USERS SOCIETY, * * DIGITAL EQUIPMENT CORPORATION * * AND THE SUPPLIERS OF SUCH PROGRAMS * * DISCLAIM ALL WARRANTIES ON THE PROGRAMS INCLUDING * * WITHOUT LIMITATION, ALL IMPLIED WARRANTIES OF * * MERCHANTABILITY AND FITNESS FOR PURPOSE. * * * *********************************************************** Introduction PAGE 3 The routines described in this document were developed to :- (1) Simplify I/O techniques for new users and to reduce program writing for experienced programmers. (2) Introduce character/text handling facilities which CORAL and MACRO. (3) Produce simplified/compatable ASCII/binary binary/ASCII conversion routines working in any base from 2 to 36. (4) Enable software to be written quickly when using the XY plotter and allow the plotter to be available to languages which have no plotter commands. The MACRO software was developed to enable fast program writing and to incorporate high level English language type commands to be available to the MACRO assembler. In general the reference numbers indicate the filenames used the extention will be either .COR or .MAC ; for example REFNO/MODULE L13A can be found in file L13A.COR note single digit numbers will have leading zeros always attached. Procedure types are indicated as so :- INT indicates an 'INTEGER''PROCEDURE' BYTE indicates a 'BYTE''PROCEDURE; FLO indicates a 'FLOATING''PROCEDURE' All modules starting with the letters MCnn and the CORAL procedures with the same name are functionally identical but the MCnn modules are in general smaller or faster but usually both. Introduction PAGE 4 For RT-11 users please ignore all references to CORAL as this is not an option with RT-11 systems.For an RT-11 system filenames the same but in some cases may have been reduced to 6 letters. All the CORAL procedures mentioned in this document can be found in the library [200,25]BASLIB.OLB (IAS/RSX) All the MACRO procedures mentioned in this document can be found in the library [200,25]MAC.OLB (IAS/RSX) MAC.OLB (RT-11) All CORAL macros required for CORAL library procedures may be found in file [200,25]MACBIO.COR All CORAL definitions required for CORAL library procedures may be found in file [200,25]GENDEF.COR All MACRO macros required for MACRO library procedures may be found in library [200,25]MAC.MLB (IAS/RSX) MAC.MLB (RT-11) Most MACRO definitions and presets can be found in the file/s [200,25]MG0.MAC (IAS/RSX) or [200,25]CONFIG.MAC (IAS/RSX) MG0.MAC or CONFIG.MAC (RT-11) All Sources may be located on magnetic tapes 150 and 151 the volume identity for these tapes is COMMON. (CAA ATCEU only) ie. to load tape :- MESS PLEASE LOAD MAGNETIC TAPE 150 OR 151 FOR READ ACCESS MOUNT/PROC:MM0ACP MM: COMMON CHAPTER 2 CORAL PROCEDURES INDEX 1 CORAL general information PAGE 6 2 CORAL String functions. PAGE 7 3 CORAL String alter or modify. PAGE 9 4 CORAL General function procedures. PAGE 14 5 CORAL TERMINAL I/O ROUTINES PAGE 15 6 CORAL General device procedures. PAGE 19 7 CORAL String numeric conversion routines. PAGE 20 8 CORAL String to non numeric convert procedures. PAGE 21 9 CORAL String convert Binary to ASCII. PAGE 22 10 CORAL File device control routine. PAGE 23 11 CORAL File device input/output routines. PAGE 25 12 CORAL STRING PRESET ROUTINES PAGE 26 13 CORAL XY Plotter routines. PAGE 27 CORAL general information PAGE 6 Library declaration for CORAL macros is as follows 'LIBRARY' BAS; (Any procedure reference number marked with a * symbol) (indicates the sources are written in both MACRO and CORAL.) To avoid confusion with general reply the file GENDEF.COR has been created for CORAL programmes therfore the replys will in the future be related to the macro reply name rather than the actual value. Some of the CORAL procedures now give a status reply as well performing the original function to assist with programme development and error detection. CORAL String functions. PAGE 7 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- LEN L01* INT This procedure will reply with the length of then named character string USAGE X:=LEN(STRING); COMPARE L02* INT This procedure compares two character strings and then answer given are :- -1 if first string less than second string or shorter 0 if first string same as second string +1 if first string greater than second string or longer usage 'IF' COMPARE (STRING1,STRING2) CONDITION 'THEN' ACTION; The MACRO reply SAME may be used. SEG L03* INT This procedure presents a segment of a character string. The parameters of the procedure are :- SEG(STRING,START POS,END POS); First parameter string to be accessed. Second parameter start access position. Third parameter end of access position. This procedure replies with the address of the segment of the master input string. USAGE 'IF' COMPARE (SEG(STRING,START,END),CHECKSTRING) CONDITION 'THEN' ACTION; USAGE COPY (SEG(STRING,START,END),STRING SEGMENT); LSEG L03A* INT As per L3 but internal local use only. COPY L04* INT This procedure copies one string to another string location. Note automatic bounds checking takes place when copying strings therefore writing past the end of a string not possible and excess characters will be lost the limit is specified when the string is initially made. N.B. The very first two bytes hold the length of the array. second two bytes hold the number of characters in the string, this is also where the string address is referenced to. usage COPY(FROM STRING,TO STRING); The MACRO replys ERROR or SUCCESS are given. CORAL String functions. PAGE 8 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- POS L05* INT This procedure checks if a sub string exists within a master string. If the sub string is not present within master string then the procedure will reply zero. If the sub string does exit within the master string then this procedure will answer with the position of the first occurrence of the sub string. usage 'IF' POS(MASTER STRING,SUB STRING,STARTPOSITION) condition 'THEN' action; usage X:=POS(MASTER STRING,SUB STRING,STARTPOSITION); LPOS L05A* INT As per L5 but local internal use only. COMSORT L28 INT This procedure behaves in a similar way to the COMPARE procedure. It has been designed to allow the user to compare character strings of differing length. The shortest string length specifies the length of comparison area + one character which is set as zero for decision purposes when all characters in the comparison area are the same. Usage as per compare procedure CORAL String alter or modify. PAGE 9 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- ADD L06 INT This procedure adds(appends) one string to another string the answer given is the address of the combined string if new string exceeds 255 characters end characters are lost. usage X:=ADD(MASTER STRING,ADD ON STRING); ADD TO L16* INT This procedure appends the second string to first string loading the resulting string into the first string usage ADD TO (MASTER STRING,ADD ON STRING); master string now equals master string plus add on string The MACRO reply ERROR or SUCCESS may be used. FILL L19 INT This procedure fills a string to a pre set point with the character specified in parameter list usage FILL(STRING,19,WITH CHARACTER); example fill a string with spaces to tab point 25 FILL(A STRING,25,A SPACE); The MACRO reply ERROR or SUCCESS may be used. CLEAR L21* INT This procedure resets a string to a length of of zero characters and resets all characters in string to zero. Note count is taken from max buffer parameter in string usage CLEAR(ADOLLAR); The MACRO reply ERROR or SUCCESS may be used. TABMOD L37 This procedure replaces all tabulation characters in a string with the correct number of space characters. USAGE TABMOD (string to modify); CORAL String alter or modify. PAGE 10 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- TABLOAD L24 INT This procedure acts as a special string which allows the user to load characters into any position within the string. Parameters:- tab load(position,character string); the procedure offers the following facilities (A) The address of the internal held string. (B) The ability to alter the internally held strings length. (C) The insertion of chars into the string. (D) The ability to fill the internally held string with spaces. information about this procedure (1) If position =-1 the procedure answers with the address of the internally held string. (2) If position is 0 the internal string is set to all spaces. (3) If position is -2 then the value of character string is now used as an integer to specify the length of the internal string the value is limited to the range 1 to 255. (4) Normal mode is when position = access position in the character string to be accessed. and character string is the address of a character string. NOTE If character string parameter is not required it should be set to either -1 or 0. USAGE X:=TAB LOAD(-1,0); (X = ADDRESS OF STRING) TAB LOAD(-2,127); (CHAR STRING LENGTH = 127) TAB LOAD(0,-1); (CHAR STRING NOW ALL SPACES) TAB LOAD(9,"ABCD");(ABCD LOADED INTO STRING) (FROM POSITION 9) CORAL String alter or modify. PAGE 11 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- CHARVER L29 INT This procedure checks that all the characters in the slave string exist in the master string. Note:- charver means 'CHARACTER VERIFY' If all character exist then the procedure answers +0 if any character in the slave string does not exist in the master string then the procedure answers with a negative value corresponding to the position of the failed value. NB. -6 would indicate that the character in position 6 is in error and caused the check to fail. USAGE Example check if all characters read from an input message are valid. ie: Valid numeric character for ASCII numeric conversion 'IF' CHARVER("0123456789.E",INPUT STRING) = SUCCESS 'THEN' NUMERIC STRING IS VALID 'ELSE' ASK TO REINPUT STRING AGAIN; GENERAL FORMAT RESULT:=CHARVER(MASTER STRING,SLAVE STRING); 'IF' CHARVER(MASTER STRING,SLAVE STRING) CONDITION 'THEN' ACTION; MULS L30 INT This procedure will present a string containing a number of repeats a sub set string. this procedure can hold a maximum of 255 characters, excess characters will be lost during the string multiplication. FORMAT MULS(SUBSTRING,NUMBER OF REPEATS); USAGE COPY(MULS("*",12),STRING1); WITH THIS EXAMPLE STRING1 = ************ CORAL String alter or modify. PAGE 12 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- SRP L32 INT This procedure replaces one string for another string located in a master string a number of times. The new string generated is then passed to the answer. parameters :- ANSWER:=SRP(MASTER,CHANGE FROM,CHANGE TO,N TIMES); usage:- ANSWER=SRP(AAA,BBB,CCC,NNN); IF NNN <0 NO ACTION TAKES PLACE. IF NNN =0 CHANGE ALL OCCURRENCES OF BBB TO CCC IN AAA. IF NNN >0 CHANGE BBB TO CCC IN AAA NNN TIMES. X:=SRP("ABCCCCDE","C","?",0); (X="AB????DE") X:=SRP("ABCCCCCDE","C",-1,4); (X="ABCDE") note -1 may be used as a void field; CYPHER L33 INT This procedure allows the user to convert a character string from one code set to another code set. Uses of this procedure could be say converting upper case characters to lower case characters or maybe some sort of security arrangement to stop other users being able to read the contents of each character string. Parameters REPLY STRING:=CYPHER(FROM,TO,ITEM TO CODE); Usage X:=CYPHER("ABCDE","12345","ABACF"); X WOULD = 1213F NOTE UNFOUND CHARACTERS NOT CONVERTED. SHIFT L34 Ths procedure is not yet written CORAL String alter or modify. PAGE 13 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- SPLIT L35 INT This procedure extracts sub fields in character strings any number of characters may be used as the field splitting delimiters. The procedure will reply SUCCESS if a character string has been extracted and ERROR if the operation has failed. Usage STATUS:=SPLIT(master,split reply,seperator); Where 'master' is the character string containing a number of sub fields. 'split reply' is the group of characters extracted from the master character string. NOTE the 'split reply' will be removed from the 'master' character string along with the seperator character group of characters. 'seperator/s' are the character/s used to terminate a sub character group in a master character string. SPLITS L35A INT This procedure extracts sub fields within character strings. This procedure differs from SPLIT in that the seperator character string consists of a series individual seperator characters each character will be checked in turn to locate where the sub character group is to be split and the delimiter character nearest to the start of the main character string will be chosen as the delimiter. The delimiter and sub character group will both be deleted from the master string EXAMPLE of use where MASTER contains the following characters A,B;C.D;E SEP contains the following characters .;, instruction SPLITS(MASTER,ANS,SEP); Content of strings MASTER ANS SEP REPEAT B,C.D;E A .;, 1 C.D;E B .;, 2 D;E C .;, 3 E D .;, 4 E .;, 5 CORAL General function procedures. PAGE 14 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- CLOCK L23 INT This procedure works as a stop watch *********************** NOT PRESENTLY AVAILABLE *********************** ASK L36 INT This procedure enables the user to ask a question with a selected number of replys and until one of the selected replys is entered the procedure will continue to re-prompt. The formal parameters are :- 'INTEGER''PROCEDURE' ASK ('INTEGER''ARRAY','VALUE''INTEGER'); The integer array should take the form 'IA" anslist [0:n]:=, terminated by 0,0; eg. 'IA' axx [0:5]:="yes",1,"no",2,0,0; USAGE REPLY := ASK(anslist,"Run again YES/NO"); CORAL TERMINAL I/O ROUTINES PAGE 15 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- VDU L07/A/B* INT PART ONE OF TWO This procedure uses QIO transfer procedures to access vdu display and vdu keyboard. The first parameter specifies the mode of working:= ie; "O" = output a string of characters. "I" = input a string of characters. "I@" = input with no echo. "I-" = input with no prompt. "(NUMBER)" = read number characters only. "NL" = output a newline at end of output "PRE" = output a preceding newline before string. "END" = ending newline same as "NL". "CLEARS"=clear screen cursor set to top lefthand side. "CLEARL"= clear all character to end of line "CLEARE"= clear all character to end of screen. "CR" = output a carriage return no line feed. "LF" = line feed but no carriage return. "REF" = set cursor to top left hand side of screen. "RET" = as per "CR" but after output of string. "SHUT"= Deallocates the lun from the vdu. or any combination maybe used ie; "IO" "IONL" "INL" "PREOINL" "PRE,O,I,END" "END I O,PRE" ETC. Note spaces and other separators used for readability only. Second parameter holds the address of output string if it is set to 0 or -1 then string is assumed that it does not exist therefore 0 or -1 should be used when it is a dummy parameter. SEQUENCE OF EVENTS. ------------------ The system allocates the vdu channel if dealocated Then the order of events is fixed and are either:- special cursor control. Or any one from each of the following lines:- clears,cleare,clearl. Set cursor to reference home position. Output a preceding newline. Output a string. Input a string with control variations. Output an ending newline. Output an ending carriage return. Shut dealalocates the vdu channel. CORAL TERMINAL I/O ROUTINES PAGE 16 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- VDU L07/A/B* INT PART TWO OF TWO Special cursor control allow the user to access any position on the VDU screen. Parameters are :- VDU("SETCUR",COLUMN VALUE *256 +LINE VALUE); An alternative method is:- 'INTEGER' REFERENCE; 'OVERLAY' REFERENCE 'WITH' 'BYTE' 'ARRAY' LC[0:1]; 'OVERLAY' LC[0] 'WITH' 'BYTE' LINE; 'OVERLAY' LC[1] 'WITH' 'BYTE' COLUMN; then for use ..... LINE := 5; COLUMN := 65; VDU("SETCUR",REFERENCE); Will cause the cursor to be moved to line 5 Will cause the cursor to be moved to column 65 Note in this mode a string cannot be output But a string may be input after cursor movement. Usage VDU(CONTROL STRING,TRANSFER STRING); Usage X:=VDU(CONTROL STRING,TRANSFER STRING); Usage X:=VDU(CONTROL STRING,-1 OR 0);(INPUT ONLY) Usage VDU(CONTROL STRING,CURSOR POSITION); Usage X:=VDU(CONTROL STRING,CURSOR POSITION); VDULUN L07G INT This procedure allows the user to redefine the logical unit number associated with the vdu/terminal If a LUN is already allocated to the terminal the LUN will be released , this procedure will then allocate the specified lun number to the terminal. This procedure may also be used to interrogate which lun is allocated to the terminal. usage X:=VDULUN(0); This request the lun number. usage VDULUN(5); This allocates lun 5 to the VDU. CORAL TERMINAL I/O ROUTINES PAGE 17 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- VDUSP L07D INT This procedure will perform the same actions as the VDU procedure but the following extra options are available:- These options only effect the input sequence. "I*" This allows input, but the procedure does not wait for the input to occur. to check if the input has occured the following method must be used. X:=VDU("?",-1); note if input not occurred answer is-1 if input has occurred answer is the address if the string 'IF' X=-1 'THEN' NO INPUT 'IF' X<>-1'THEN' X:=ADDRESS OF STRING Please note that the "?" mode inhibits all other mode of operation. usage: VDUSP("I* O","INPUT CHAR TO STOP"); LOOP: PERFORM OPERATION; 'IF' VDUSP("?",-1)=-1 'THEN''GOTO'LOOP SYS L07S INT This procedure allows the user to read the value of a single character from the users terminal. This procedure will not echo the character to the terminal. Usage A:=SYS(1); Note the parameter value (1) is used to indicate what type of function is required. Note only value (1) is allowed. INKEYS L07I INT This procedure allows the user to read a characters from the users terminal with character echo. This procedure will not wait as with the SYS (1) function and unlike the SYS(1) function this procedure answers in string format. If no character has been recieved on the users terminal then this procedure will reply with a string with no charcters in it. USAGE A:=INKEYS; (HOLD STRING ADDRESS) USAGE 'IF' LEN(INKEYS)=0 'THEN' ... 'ELSE' ... CORAL TERMINAL I/O ROUTINES PAGE 18 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- TERMINAL L27 This procedure allows special options to be set on the VDU terminal. the options are as follows:- "UCO" UPPER CASE OUTPUT "LCO" LOWER CASE OUTPUT "UCI" UPPER CASE INPUT "LCI" LOWER CASE INPUT "HD" HALF DUPLEX MODE "FD" FULL DUPLEX MODE the default options are "UCO,UCI,HD". this procedure allows you to do the same action as a set terminal operation under PDS control. Usage TERMINAL(CONTROL STRING); WHERE (CONTROL STRING) may be any one or more of the above options seperated by a comma if more than one option required. eg; TERMINAL("LCO,LCI,FD"); CORAL General device procedures. PAGE 19 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- RTO4 L07C/E/B INT This procedure has a similar function to the VDU procedure but rather than accessing your VDU it will drive any RTO4 channel of your choice. At the time of writing we have two choices of RTO4 device, to be able to select which version of RTO4 we wish to use (type0) is the old version and (type1) the new style RTO4. We must be able to distinguish because they have different code sets on some of the special functions. Any mode offered by the VDU procedure is permissable with the RTO4 procedure. This procedure has the following extra facilities :- MODE= ACTION "ASSIGN" Assign RTO4 channel where string holds the device name ie; "TT51:". it is at this point that we select which type of RTO4 we wish to use ie; "ASSIGN TYPE0" OR "ASSIGN TYPE1" "ASSIGN TYPE0" is the default option. ie; "ASSIGN" = "ASSIGN TYPE0". "ASSIGN INPUT" device for input only. "ASSIGN OUTPUT"device for output only. The above modes used when input and output required on different channels. "OVER" This option used with "ASSIGN" it stops the display being initialised. "CB" Cursor begin. "CE" Cursor end. "FB" Flash begin. "FE" Flash end. "DSB" Double size begin. (type0 only) "DSE" Double size end. (type0 only) "RVB" Reverse video begin. (type1 only) "RVE" Reverse video end. (type1 only) "FLASH" Output string flashing at start. flashing stops at end. NOTE1 IF "DSB" OR "DSE" USED WITH TYPE1 RTO4 THIS procedure assumes you required reverse video option likewise with "RVB" AND "RVE" type0 RTO4 assumes double size characters required. NOTE2 As with the VDU procedure the special set cursor or assign device modes of operation no other function is allowed. NOTE3 With type1 RTO4s 4 pages are available to select which page to use when using "SETCUR" command. second parameter = column*256+page*64+line. usage as per VDU procedure. Formal parameters of RTO4 procedure. INPUT REPLY:=RTO4(CONTROL MODE,OUTPUT STRING); CORAL String numeric conversion routines. PAGE 20 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- STR L08 INT This procedure produces a string result from a floating point number in either a fixed format or unformated. Note 0 or -1 as control format means unformat option. format string take same form as CORAL PROCEDURE FCHAR IE. "F10.3". Usage X:=STR(FORMAT STRING,FLOATING VALUE); Usage X:=STR(-1,21.4); Usage X:=STR("F10.3",99.8E-2); VAL L10* FLO This procedure converts a string into a floating point number using any base from 2 to 36, the default assumed to be base 10. The following values are all considered to be valid by this procedure using base 10 :- .01 0.01E-1 +0.01 -0.01 -1E+5 +1E-5 5.2 -.5 5 +.5 ETC. To use other bases the base required is enclosed in (brackets) and appended to the string to be converted as so :- OCTAL 1767(8) HEX AB01F(16) DECIMAL 55.09(10) or 55.09 by default BINARY 10011(2) Note the base value always described using base 10. Note the use of a non base 10 value does not inhibit the use of either the + sign - sign or fractional point operator, ie. these are valid numbers +10.11(2) -EF.C(22) Usage X:=VAL(STRING); CORAL String to non numeric convert procedures. PAGE 21 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- ASC L09 BYTE This procedure replys with the value of the first character held in specified string usage X:=ASC(STRING); Usage C:=ASC("B"); (INTEGER C = 66) RADASC L25 INT This procedure converts three ASCII chars into a signed integer in RAD50 code answer to this procedure take the form bit 0 set char 1 is not permissable RAD50 character bit 1 set char 2 is not permissable RAD50 character bit 2 set char 3 is not permissable RAD50 character ie; if answer value =7 all chars not converted if answer value =5 chars 1 and 3 not converted if answer value =0 then operation successful usage:- RADASC(CHAR1,CHAR2,CHAR3,RESULT); 'IF' RADASC(4 PRAMS)=0 'THEN' OPERATION OK 'ELSE' BIT INDICATES INVALID CHAR; Note this procedure also can be found in CORALIOPROCS R50ASC L25A INT This procedure converts three ASCII characters in the form of a string into a signed integer in RAD50 code. If any of the characters in the string are not valid RAD50 characters this procedure replies with the value -1 which is a non translateable RAD50 code. If the input string exceeds 3 characters only the first 3 characters are used. Usage A:=R50ASC("ABC"); ASCRAD L26 INT This procedure converts a signed integer (RAD50 CODE) into three ASCII characters. If answer not zero then translation not performed correctly all characters must be suspect usage:- ASCRAD(CHAR1,CHAR2,CHAR3,TRANS VALUE); 'IF' ASCRAD(4 PRAMS)<>0'THEN' OP FAILED 'ELSE' OPERATION OK; Note this procedure also can be found in CORALIOPROCS ASCR50 L26A INT This procedure converts a signed integer in RAD50 code into three ASCII character. If the input value cannot be translated correctly this procedure answers with the value -1 a correct translation this procedure answers with the address of the converted string. Usage A:=ASCR50(RAD50 code); CORAL String convert Binary to ASCII. PAGE 22 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- CVT L31 INT This procedure converts a floating point number into ASCII code. Its action is similar to FCHAR procedure in CORALIOPROCS but with this procedure you have the option of selecting what base you wish to work in. The base range is 2 to 36 the default base is assumed to be 10. sequence 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ. ie. base 16 = 0123456789ABCDEF. The parameter of this procedure are as follows :- CVT(FORMAT STRING,NUMBER TO BE CONVERTED) the format string is declared as follows :- select base to work in (base) output format ####.### Note 1 # sign indicates where a converted character is to be placed. decimal point specifies where decimal point is to be placed. If the number input is negative you will need an extra # for the - sign. if the number input will not fit in the specified format string all numeric slots will be filled with * characters. Spaces will be filled into any unused slots in integer part of format string zeros will be filled into any unused fraction slots. If a 0 character is places in the format string unused slots preceding first integer will be filled with zeros. USAGE X:=CVT("(2)############",NUMBER); number converted to base 2 field width 12 characters usage X:=CVT("(2)0######.##",15.5); output would be 001111.10 base 2 zero precede. usage X:=CVT("(2)######.##",15.5); output would be 1111.10 base 2 space precede. CORAL File device control routine. PAGE 23 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- FILE L15 INT PART ONE OF TWO This procedure will open/close or close all files opened by this procedure if this procedure answers -1 operation requested has failed to be performed, an error report will also be generated by default with the procedure waiting for an input indicating the report has been acknowledged. The files that can be opened/closed have a range 3 to 14 at time of writing although this range may be extended at a later date. parameters :- (file lun number) (mode)(name) mode :- "SHUTDOWN" WILL CLOSE ALL OPEN FILES. LUN and NAME may be defaulted using -1. "CLOSE" WILL CLOSE FILE SPECIFIED BY LUN. "KILL" WILL DESTROY FILE IF THE FILE IS OPEN. If the file is closed and a name is specified then this procedure will open the file then destroy it. If the file is closed and no name is specified then the procedure will request you to input a filename then the procedure will destroy the file that you have specified. "?" This option allows you to check if a file is open or closed. reply answers as follows :- FREE = file closed ALLOCATED = file open "NOSTOP" If this mode is selected the procedure will not wait for an input after an error report has been output. "NORPT" If this mode is selected neither the internal error reporting system or the wait after error condition will be performed. "OPEN INPUT" Will open a file for input "OPEN OUTPUT" or "OPEN OUTPUT FIXED(30)" Will open a file for output. If fixed is used output records fixed at length in brackets (IE 30). CORAL File device control routine. PAGE 24 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- FILE L15 INT PART TWO OF TWO NAME :- Is the 'DEVICE' : 'UIC' 'FILENAME' of the device to be used when opening for output sequence of events :- shutdown or close or open the effects of shutdown or close close release exit the effects of open deflun open/create exit The MACRO's SUCCESS and ERROR indicate if the procedure has operated corectly. Usage FILE(UNIT NUMBER,MODE STRING,FILENAME); Usage 'IF' FILE(FILE NUMBER,MODE,FILENAME) <> SUCCESS 'THEN' ASSUME OPERATION HAS FAILED; CORAL File device input/output routines. PAGE 25 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- FILEIN L11 INT This procedure reads a record from a device set up by the file procedure and converts it into a valid string variable. possible answers from this procedure:- address of string EOF if end of file ERR or ERROR if other errors usage X:=FILEIN(FILE NUMBER); LFILEIN L11A INT This procedure works in a similar manner to filein but rather than using an internal data area the receiver data area is specified as a parameter. possible answers from this procedure:- EOF if end of file. ERR or ERROR if other errors. PARAMETERS X:=LFILEIN(FILE NUMBER,STRING NAME); USAGE X:=LFILEIN(FILE NUMBER,STORE AREA); LFILEIN(FILE NUMBER,STORE AREA); NOTE LFILEIN(3,AS) SAME AS COPY(FILEIN(3),AS); BLOCKIN L11B INT This procedure reads a block from a device set up by the file procedure and converts it into a valid string variable. Possible answers from this procedure:- Address of string EOF If end of file ERR or ERROR for other errors Usage X:=BLOCKIN(device number); LBLOCKIN L11C INT This procedure works in a similar manner to blockin but rather than using an internal data area the receiver data area is specified as a parameter. Possible answers from this procedure:- 0 if success EOF if end of file. ERR or ERROR for other errors. Parameters X:=LBLOCKIN(devicenumber,string name); Usage X:=LBLOCKIN(device number,store area); LBLOCKIN(device number,store area); (no checks) Note LBLOCKIN(3,AS) same as COPY(BLOCKIN(3),AS); FILEOUT L12 INT This procedure transfers a string in record form to output device set up by procedure file. The MACRO's SUCCESS or ERROR indiacte if the operation succeded. Usage FILEOUT(FILE NUMBER,STRING TO TRANSFER); BLOCKOUT L12A INT This procedure transfers a string in block form to output device set up by procedure file. The MACRO's SUCCESS or ERROR indiacte if the operation succeded. Usage BLOCKOUT(DEVICE NUMBER,STRING TO TRANSFER); CORAL STRING PRESET ROUTINES PAGE 26 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- CHR L13 INT This procedure presents a 'VALUE''BYTE' as a string of length 1 Usage X:=CHR(ASCII CHARACTER VALUE); Usage CHR(12) = (FORM FEED CHARACTER) QUOTE L14 INT This procedure presents a string of length 1 and its contents is a quote (') character as it is difficult to insert a (') char in a literal string usage use instead of a ' CHARACTER A SPACE L17 INT This procedure replies with the address of a string containing a single space usage practical example ADD TO (MASTER STRING,A SPACE); now master string equals master string plus a space A TAB L18 INT This procedure replies with the address of a string containing a single tab usage as per (A SPACE) procedure CRLF L20 INT This procedure replies with the address of a string containing a cr plus a lf usage as per (A SPACE) procedure DAT L22 INT This procedure presents a character string of the date in the form day/month/year usage as per (A SPACE) procedure UIC L22A INT This procedure present a character string of the user identity code in the form [group,member] that you are presently logged into. Usage as per (A SPACE) procedure. CLK L23 INT This procedure presents a character string of the time in the form hours:minutes:seconds usage as per (A SPACE) procedure CORAL XY Plotter routines. PAGE 27 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- TXT P01 This procedure plots the contents of a character string to the XY PLOTTER. Usage TXT(angle of text,size of text,text); Where size of text is an integer value in the range 1 to 12. The size number refers to a multiplying factor of size times 0.7 cms for height and width of the characters. The angle of text specifies what angle the characters will be drawn at. MOV P02 This procedure moves the XY PLOTTER pen to the X,Y position relative to the origin which is fixed as X=0 and Y=0 ie the bottom left hand corner of the paper. All X and Y values in cms. If the X value is negative then rather than an XY position being specified this procedure assumes the coordinates are RADIUS/THETA movement relative to the present pens position. Note a negative X is forced to a positive radius value in cms and Y value assumed to be degrees. PLT P03 This procedure works in a similar manner to the MOV procedure but rather than just moving the pen this procedure draws a line between the pens start position and the parameter X,Y values. CIR P04 This procedure draws a circle about the position is complete Usage CIR(radius in cms); RED P05 This procedure selects the red pen for plotting. Usage RED; BLK P06 This procedure selects the black pen for plotting. Usage BLK; RTH P07 This procedure converts R/THETA values to X,Y values. Local internal use only. CORAL XY Plotter routines. PAGE 28 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- DTOR P08 This procedure converts degrees to radians Local internal use only. ARC P09 This procedure draws a segment of a circle around the position the pen is initially positioned and returns the pen to the centre of the arc when the drawing is complete. Usage ARC(arc radius,center angle,width in degrees); DEV P10 This procedure draws the outline to scale of number of semiconductor devices. ie 8 pin ICs 14 pin DIL transistor cases resistors and capacitors. ********************* NOT YET AVAILABLE ********************* ARR P11 This procedure draws an arrow head, suitable for dimensioning diagrams. USAGE ARR(size,angle arrow head points); SQR P12 This procedure draws a square centred about the position the pen is initially positioned on completion of the drawing the pen is returned to the initial position. USAGE SQR(length of a side); PLS P13 This procedure draws a plus symbol or crossing axis. USAGE PLS(size of symbol); CRS P14 This procedure draws a cross symbol. USAGE CRS(size of symbol); CCT P15 This procedure draws a sketch of a piece of vero-board with matrix 0.1 inches, the output can be used to plan the layout of circuits. USAGE CCT(width of board,length of board); ************************ NOT YET AVAILABLE ************************ SIZE P16 This procedure allows the user to enlarge or reduce the size of the plot being output. USAGE SIZE(multiplication factor); NEWFRM This procedure causes the plotter to form feed to a new page to plot on. This procedure is part of the system main plotter library. USAGE NEWFRM; CHAPTER 3 CORAL Debug and Error procedures. INDEX 1 Introduction PAGE 30 2 Procedure facilities. PAGE 31 Introduction PAGE 30 These routines are written in MACRO 11 to interface and be used with CORAL 66 programmes run under the IAS system. The INTEGER/STRING routines are aimed to be used for error reporting and quick diagnostics prompts but only introducing minimal code overheads as compared with the TIDEF group of instructions ie. SINPUT IINPUT SPRINT IPRINT use approx octal 400 bytes + 100 bytes in PSECT $$DEVT in total where as TIDEF group will use 200 bytes in PSECT $$DEVT in PSECT $FSCR1 2040 and in PSECT $$IOBF will use 430 bytes this excludes any store requirement used by the code itself it can therfore be seen that when store space is at a preimum these routines will be very useful. A further set of routines have been developed to analyise the status of memory management data arrays and report the status of the DSW in plain language. For convenence these routines are held in the library [200,25]BASLIB but before you use them you must make the formal declarations in your programme to these procedures. Procedure facilities. PAGE 31 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- SPRINT M04 This procedure displays a character string onto the users terminal. PARAMETERS SPRINT ('VALUE''INTEGER','VALUE''INTEGER'); SPRINT (LUN,STRING TEXT); USAGE SPRINT (1,"HAPPY DAYS ARE HERE AGAIN"); IPRINT M04 This procedure displays a signed integer result on the users terminal. PARAMETERS IPRINT ('VALUE''INTEGER','VALUE''INTEGER'); IPRINT (LUN,VALUE TO DISPLAY); USAGE IPRINT (2,44); USAGE IPRINT (1,AN INTEGER); Procedure facilities. PAGE 32 NAME REFNO. TYPE DESCRIPTION ---- ----- ---- ----------- SINPUT M04 INT This procedure reads a character string from the users terminal and replys with the address of the character string. A maximum of 80 characters is allowed on any entry tho the string may be terminated by either the escape or return keys. PARAMETERS 'INTEGER''PROCEDURE' SINPUT ('VALUE''INTEGER'); 'INTEGER''PROCEDURE' SINPUT (LUN); USAGE STRING ADDRESS := SINPUT (1); IINPUT M04 INT This procedure read a character string from the users terminal the converts the string into a signed integer value illegal characters are ignored and no status replys given for overflow etc. 'INTEGER''PROCEDURE' IINPUT ('VALUE''INTEGER'); 'INTEGER''PROCEDURE' IINPUT (LUN); USAGE VALUE INTEGER := IINPUT (1); CHAPTER 4 MACRO Routines. INDEX 1 STRING CHECK AND LOCATE GROUP PAGE 34 2 Character string alter modify group PAGE 36 3 Character string shift routines PAGE 38 4 Preset routines PAGE 39 5 Binary value to character string convert routines PAGE 40 6 Character string to binary value convert routines. PAGE 41 7 Numeric character string tidy routines. PAGE 42 8 Character string to non numeric format convert routines PAGE 43 9 Character manipulation routines. PAGE 44 10 File and Block control routines PAGE 49 11 General purpose routines PAGE 51 12 Queue manipulation routines PAGE 52 13 Terminal input/output routines PAGE 53 STRING CHECK AND LOCATE GROUP PAGE 34 NAME MODULE DESCRIPTION ---- ------ ----------- R$POS3 MR05 This procedure locates the position of a search string within a master string starting from a requested character position. ENTRY POINTS +0 Match characters exact +2 Match same for upper/lower case ENTRY CONDITIONS R1 -> MASTER STRING R2 -> SEARCH STRING R0 = START POSITION OF SEARCH EXIT CONDITIONS SEE R$POS R$POS2 MR05 This procedure locates the position of a search string within a master string always starting from the first character in the master string. ENTRY POINTS +0 Match characters exact +2 Match same for upper/lower case ENTRY CONDITIONS R1 -> MASTER STRING R2 -> SEARCH STRING EXIT CONDITIONS SEE R$POS R$POS MR05 This procedure is a common routine for R$POS3 and R$POS2 it locates the position of one string within another string. ENTRY CONDITIONS R3 R4 AND R5 MUST BE SAVED R1 -> MASTER STRING ADDRESS R2 -> SEARCH STRING ADDRESS R0 = START POINT IN STRING TO SEARCH FROM EXIT CONDITIONS R0 = POSITION OF FIRST CHARACTER IF MATCH FOUND R0 = ZERO IF NO MATCH FOUND EXITSUCCESS IF MATCH FOUND EXITERROR IF MATCH NOT FOUND STRING CHECK AND LOCATE GROUP PAGE 35 NAME MODULE DESCRIPTION ---- ------ ----------- R$COMPARE MR11 This procedure compares the contents of two character strings and indicates if the strings are the same or how they differ. ENTRY POINTS +0 Match characters exact +2 Match assume upper/lower case same ENTRY CONDITIONS R1 -> STRING A R2 -> STRING B EXIT CONDITIONS IF (STRING A) IS LESS THAN OR SHORTER THAN (STRING B) R0=-1 IF (STRING B) IS LESS THAN OR SHORTER THAN (STRING B) R0=1 IF BOTH STRINGS ARE THE SAME R0 = 0 THE STATUS INDICATOR ALSO INDICATES IF THE STRINGS ARE THE SAME EXITSUCCESS IF STRINGS THE SAME. EXITERROR IF STRINGS DIFFERENT. Character string alter modify group PAGE 36 NAME MODULE DESCRIPTION ---- ------ ----------- R$ADDTO MR12 This procedure appends(adds) one string to a master string. ENTRY CONDITIONS R1 -> MASTER CHARACTER STRING R2 -> STRING TO APPEND EXIT CONDITIONS R1 -> MASTER CHARACTER STRING R2 -> STRING THAT HAS BEEN APPENDED R$CLEAR MR13 This procedure clears out a character string. ENTRY CONDITIONS R0 -> CHARACTER STRING EXIT CONDITIONS STATUS = SUCCESS IF OPERATION IS SUCCESS R$DELETE MR04 This procedure deletes a number of characters in a string ENTRY CONDITIONS R1 -> MASTER STRING R2 = THE START POSITION WHERE DELETION IS TO START R3 = THE NUMBER OF CHARACTERS TO DELETE EXIT CONDITIONS R1 -> THE MODIFIED MASTER STRING R$REVERSE MR07 This procedure reverses all the characters held in a character string. ENTRY CONDITIONS R0 -> CHARACTER STRING TO BE REVERSED EXIT CONDITIONS R0 -> CHARACTER STRING Character string alter modify group PAGE 37 NAME MODULE DESCRIPTION ---- ------ ----------- R$SEG MR14 This procedure extracts a segment of a character string minimum size one character to maximum size of the string being processed. ENTRY CONDITIONS R1 -> INPUT STRING R2 = START POSITION R3 = END POSITION R4 -> OUTPUT STRING EXIT CONDITIONS R4 -> THE EXTRACTED STRING (NOTE THE INPUT STRING IS LEFT UNMODIFIED) R$WEDGE MR06 This procedure inserts/wedges one string into a second string. ENTRY CONDITIONS R1 -> MASTER STRING R2 -> STRING TO INSERT R3 = THE CHARACTER POSITION TO INSERT THE STRING AFTER EXIT CONDITIONS R1 -> THE MODIFIED MASTER STRING R$PAD MR16 This procedure pads out a string with a spec- -ified character and by a specified number of characters. Alternatively if the character count is '0' then it with fill up the remain -der of the string ENTRY CONDITIONS R0 -> ADDRESS OF STRING. R1 = NUMBER OF CHARS TO PAD WITH. R2 = CHARACTER TO PAD WITH. EXIT CONDITIONS Success or error. Character string shift routines PAGE 38 NAME MODULE DESCRIPTION ---- ------ ----------- R$SHRE MR08 This procedure shifts the contents of a character string one character right end around. ENTRY CONDITIONS R0 -> CHARACTER STRING ADDRESS EXIT CONDITIONS R0 -> CHARACTER STRING ADDRESS R$SHR MR10 This procedure shifts the contents of a character string one character place right. ENTRY CONDITIONS R0 -> CHARACTER STRING ADDRESS R3 = FILLER CHARACTER EXIT CONDITIONS R0 -> CHARACTER STRING ADDRESS R$SHL MR10 This procedure shifts the contents of a character string one character place left. ENTRY CONDITIONS R0 -> CHARACTER STRING ADDRESS EXIT CONDITIONS R0 -> CHARACTER STRING ADDRESS R$SHLE MR09 This procedure shifts the contents of a character string one character left end around. ENTRY CONDITIONS R0 -> CHARACTER STRING ADDRESS EXIT CONDITIONS R0 -> CHARACTER STRING ADDRESS Preset routines PAGE 39 NAME MODULE DESCRIPTION ---- ------ ----------- R$CLK MR20 This procedure replies with a character string giving the time of day in the following format HH:MM:SS . ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> STRING ADDRESS HOLDING THE TIME R$DAT MR20 This procedure replies with a character string giving the date in the following format DD-MM-YY . ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> STRING ADDRESS HOLDING THE DATE R$UIC MR19 This procedure replies with a character string giving the default UIC the present running is working under in the following format [ggg,mmm] . ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> STRING ADDRESS HOLDING THE UIC Binary value to character string convert routines PAGE 40 NAME MODULE DESCRIPTION ---- ------ ----------- R$BBIN MR02 This procedure converts a sixteen bit binary word into a significant zero string of ASCII characters using base two. ENTRY CONDITIONS R0 = BINARY VALUE WORD ENTRY +0 BYTE ENTRY +2 EXIT CONDITIONS R0 -> CONVERTED STRING R$BDEC MR01 This procedure converts a sixteen bit binary word into a signed significant zero string of ASCII characters using base ten. ENTRY CONDITIONS R0 = BINARY VALUE EXIT CONDITIONS R0 -> CONVERTED STRING R$BHEX MR02 This procedure converts a sixteen bit binary word into a significant zero string of ASCII characters using base sixteen. ENTRY CONDITIONS R0 = BINARY VALUE WORD ENTRY +0 BYTE ENTRY +2 EXIT CONDITIONS R0 -> CONVERTED STRING R$BINB MR03 This procedure converts a character string into a signed sixteen bit word the input is assumed to be in base two. ENTRY CONDITIONS R0 -> ASCII STRING ADDRESS EXIT CONDITIONS R0 = CONVERTED VALUE IF STATUS = SUCCESS R$BOCT MR02 This procedure converts a sixteen bit binary word into a significant zero string of ASCII characters using base eight. ENTRY CONDITIONS R0 = BINARY VALUE WORD ENTRY +0 BYTE ENTRY +2 EXIT CONDITIONS R0 -> CONVERTED STRING Character string to binary value convert routines. PAGE 41 NAME MODULE DESCRIPTION ---- ------ ----------- R$HEXB MR03 This procedure converts a character string into a signed sixteen bit word the input is assumed to be in base sixteen. ENTRY CONDITIONS R0 -> ASCII STRING ADDRESS EXIT CONDITIONS R0 = CONVERTED VALUE IF STATUS = SUCCESS R$OCTB MR03 This procedure converts a character string into a signed sixteen bit word the input is assumed to be in base eight. ENTRY CONDITIONS R0 -> ASCII STRING ADDRESS EXIT CONDITIONS R0 = CONVERTED VALUE IF STATUS = SUCCESS R$DECB MR03 This procedure converts a character string into a signed sixteen bit word the input is assumed to be in base ten. ENTRY CONDITIONS R0 -> ASCII STRING ADDRESS EXIT CONDITIONS R0 = CONVERTED VALUE IF STATUS = SUCCESS R$STRB MR03 This procedure converts a character string into a signed sixteen bit word. ENTRY CONDITIONS R0 = ADDRESS OF CHARACTER STRING EXIT CONDITIONS R0 = CONVERTED STRING VALUE IF STATUS = SUCCESS Numeric character string tidy routines. PAGE 42 NAME MODULE DESCRIPTION ---- ------ ----------- R$NTDY MR21 This procedure tidies a numeric character string created in the form the output result being in the value is negative the sign is retained and leading zeros removed. ENTRY POINTS (+0) REMOVE LEADING ZEROS AND SIGN IF IT IS A PLUS (+2) CONVERT LEADING ZEROS TO SPACES (+4) REMOVE SIGN CHARACTER IF IT IS A PLUS ENTRY CONDITIONS R0 -> NUMERIC CHARACTER STRING EXIT CONDITIONS R0 -> MODIFIED STRING Character string to non numeric format convert routines PAGE 43 NAME MODULE DESCRIPTION ---- ------ ----------- R$BASC MR18 This procedure converts a binary value into printable ASCII characters. Non printable ASCII characters are designated as so :- characters with values below decimal 32 are assumed to be control characters and are displayed ^control character. The erase character is displayed as ^? . ie. character code 3 will be displayed as ^C ENTRY CONDITIONS R0 = BINARY VALUE EXIT CONDITIONS R0 -> ADDRESS OF STRING R$BR50 MR15 This procedure converts a binary value into three radix 50 ascii characters in string format. ENTRY CONDITIONS R0 = BINARY VALUE EXIT CONDITIONS R0 -> ASCII STRING IF STATUS = SUCCESS R$R50L MR17 This procedure converts ASCII characters to radix 50 code load data sequentially into store. ENTRY POINTS +0 NORMAL +2 INITIALISATION ENTRY ENTRY CONDITIONS R0 = ASCII CHARACTER (ENTRY +0 ONLY) R4 -> OUTPUT STORAGE AREA EXIT CONDITIONS STATUS = SUCCESS OR ERROR R4 -> LAST LOADED RADIX 50 WORD Character manipulation routines. PAGE 44 NAME MODULE DESCRIPTION ---- ------ ----------- R$ADDC MRC03 This procedure appends/adds a character to a character string. ENTRY CONDITIONS R0 HOLDS CHARACTER TO ADD TO STRING R4 -> CHARACTER STRING EXIT CONDITIONS EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED. R$ADDS MRC12 This procedure appends/adds a character string to a character string. ENTRY CONDITIONS R0 -> CHARACTER STRING TO ADD TO STRING R4 -> CHARACTER STRING EXIT CONDITIONS EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED. R$CMPC MRC09 This procedure compares to characters and checks if they are the same uppercase/lowercase characters are assumed to have the same value. ENTRY CONDITIONS R1 -> THE ADDRESS OF CHARACTER (A) R2 -> THE ADDRESS OF CHARACTER (B) EXIT CONDITIONS IF CHARACTERS SAME STATUS = SUCCESS IF CHARACTERS DIFFER STATUS = ERROR Character manipulation routines. PAGE 45 NAME MODULE DESCRIPTION ---- ------ ----------- R$CR50 MRC08 This procedure converts a character to its radix 50 code. ENTRY CONDITIONS R0 = CHARACTER TO CONVERT EXIT CONDITIONS R0 = CONVERTED CHARACTER IF STATUS = SUCCESS R0 = -1 IF STATUS = ERROR R$DELC MRC05 This procedure deletes a character within a character string at a specified position. ENTRY CONDITIONS R1 -> STRING ADDRESS R2 = CHARACTER POSITION TO DELETE EXIT CONDITIONS R1 -> STRING ADDRESS R2 = CHARACTER POSITION TO DELETE EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED Character manipulation routines. PAGE 46 NAME MODULE DESCRIPTION ---- ------ ----------- R$GETC MRC01 This procedure extract a character from a character string from a requested position. ENTRY CONDITIONS R1 -> STRING ADDRESS R2 -> CHARACTER POSITION TO EXTRACT EXIT CONDITIONS R0 HOLDS EXTRACTED CHARACTER EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED R$INSC MRC04 This procedure inserts a character after a noted position in a string. ENTRY CONDITIONS R0 = THE CHARACTER TO INSERT R1 -> STRING ADDRESS TO HAVE CHARACTER INSERTED R2 = THE POSITION AFTER WHICH THE CHARACTER IS INSERTED EXIT CONDITIONS EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED R$LCUC MRC10 This procedure converts a lowercase alpha to an uppercase alpha all other characters remain unchanged. ENTRY CONDITIONS R0 = CHARACTER TO CONVERT EXIT CONDITIONS R0 = CONVERTED CHARACTER R$MODC MRC02 This procedure modifies/overwrites a character within a character string at a requested position. ENTRY CONDITIONS R1 -> STRING ADDRESS R2 -> CHARACTER POSITION TO EXTRACT R0 = REPLACEMENT CHARACTER EXIT CONDITIONS EXITERROR IF INVALID CONDITIONS OR OPERATION FAILED Character manipulation routines. PAGE 47 NAME MODULE DESCRIPTION ---- ------ ----------- R$MOVC MRC07 This procedure removes the first character out of a string and reduces the string length by one character. ENTRY CONDITIONS R1 -> STRING ADDRESS EXIT CONDITIONS R0 = EXTRACTED CHARACTER IF STATUS = SUCCESS R$POSC MRC06 This procedure locates a character within a character string. ENTRY CONDITIONS R0 = CHARACTER TO LOCATE R1 -> CHARACTER STRING R2 = START POSITION FOR LOCATE TO START EXIT CONDITIONS R2 = POSITION OF CHARACTER IF STATUS = SUCCESS R$POSS MRC06 This procedure locates a character within a character string. ENTRY CONDITIONS R0 = CHARACTER TO LOCATE R1 -> CHARACTER STRING EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY Character manipulation routines. PAGE 48 NAME MODULE DESCRIPTION ---- ------ ----------- R$R50C MRC08 This procedure converts a radix 50 code to an ASCII character. ENTRY CONDITIONS R0 = CHARACTER TO CONVERT EXIT CONDITIONS R0 = CONVERTED CHARACTER IF STATUS = SUCCESS R0 = -1 IF STATUS = ERROR R$UCLC MRC11 This procedure converts an uppercase alpha to a lowercase alpha all other characters remain unchanged. ENTRY CONDITIONS R0 = CHARACTER TO CONVERT EXIT CONDITIONS R0 = CONVERTED CHARACTER File and Block control routines PAGE 49 NAME MODULE DESCRIPTION ---- ------ ----------- F$NAME MF01 This procedure validates a filename and sets up an internal default filename descriptor block (DFNB). ENTRY CONDITIONS R0 -> FILENAME STRING ADDRESS EXIT CONDITIONS R0 -> DEFAULT FDB IF STATUS = SUCCESS F$GETR MF02 This procedure reads a record from the file specified by the FBD pointed at by the location F$FDB. The record length and data buffer information is taken from the string address. ENTRY CONDITIONS R0 -> STRING BUFFER TO BE LOADED EXIT CONDITIONS R0 -> LOADED STRING IF STATUS = SUCCESS F$SHUT MF03 This procedure closes down the file specified by the FDB pointed at by the location F$FDB. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS FLAG ONLY F$PUTR MF04 This procedure writes a record to the file specified by the FDB pointed at by the location F$FDB. Information about the record is taken from the string for output. ENTRY CONDITIONS R0 -> STRING TO BE OUTPUT EXIT CONDITIONS STATUS FLAG ONLY File and Block control routines PAGE 50 NAME MODULE DESCRIPTION ---- ------ ----------- F$OPEN MF05 This procedure opens the file specified by the FDB pointed at by the location F$FDB. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS FLAG ONLY F$SETUP MF06 This procedure sets up the FDB controlled by the flags set in location F$TYPE. ENTRY CONDITIONS R0 -> STRING HOLDING DEFAULT FILENAME BLOCK EXIT CONDITIONS STATUS FLAGS ONLY F$DIAG MF07 This procedure output the state of the present FDB (file descripter block) and the DFNB (default filename block) onto the terminal. The location F$FDB points to the FDB that will be processed. ENTRY CONDITIONS NONE EXIT CONDITIONS NONE F$SWITCH MF08 This procedure uses the location F$LUN to switch the FDB (file descriptor block) address in location F$FDB ie. this is the channel switch routine. ENTRY CONDITIONS F$LUN MUST BE VALID EXIT CONDITIONS NONE General purpose routines PAGE 51 NAME MODULE DESCRIPTION ---- ------ ----------- R$ADDRESS MG01 This procedure checks that a string address is a valid address. ENTRY CONDITIONS R0 = STRING ADDRESS EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY R$BITSET MG06 This procedure sets up a bit mask. ENTRY CONDITIONS R1 = POSITION OF BIT TO BE SET EXIT CONDITIONS R1 = BIT MASK R$BITPOS MG07 This procedure indicates the position of the lowest positioned bit set in a bit pattern. ENTRY CONDITIONS R1 = BIT PATTERN/MASK EXIT CONDITIONS R1 = POSITION IF STATUS = SUCCESS R$PARITY MG13 This procedure checks the parity state of a binary value and also counts the number of bits set. ENTRY CONDITIONS R0 = BIT PATTERN EXIT CONDITIONS -8.(SP) = ONE'S COUNT OF R0 STATUS = SUCCESS IF PARITY = EVEN STATUS = ERROR IF PARITY = ODD R$SAVE MG14 This procedure saves the registers R0 to R5 on the stack. It has no entry or exit condi -tions. R$UNSAVE MG14 This procedure is the converse of R$SAVE and unsaves registers R0 to R5 from the stack.It has no entry or exit conditions. Queue manipulation routines PAGE 52 NAME MODULE DESCRIPTION ---- ------ ----------- R$QADD MR23 This procedure adds/appends a character to queue ring buffer. ENTRY CONDITIONS R0 = THE CHARACTER TO LOAD INTO THE QUEUE R4 -> THE ADDRESS OF THE QUEUE BUFFER EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY R$QREM MR24 This procedure extracts/removes a character from a queue ring buffer. ENTRY CONDITION R1 -> THE ADDRESS OF THE QUEUE BUFFER EXIT CONDITIONS R0 = EXTRACTED CHARACTER IF STATUS = SUCCESS R$QTST MR25 This procedure tests that there is enough room in the queue to allow another character to be added to the buffer. ENTRY CONDITIONS R4 -> THE ADDRESS OF THE QUEUE BUFFER EXIT CONDITIONS STATUS OR ERROR ONLY ERROR = NO FREE SPACE Terminal input/output routines PAGE 53 The following procedures automatically assigns logical unit V$LUN assigned to TI0: NAME MODULE DESCRIPTION ---- ------ ----------- V$IO MG02 This procedure performs both input and output operation on the terminal TI0: where the mode string controls a series of screen operations. (See VDU module L7A for information on the format) (of the mode string) ENTRY CONDITIONS R1 -> MODE STRING R2 -> DATA STRING EXIT CONDITIONS R0 -> REPLY STRING V$TX MG04 This procedure transmits the character string address held in R0 to the terminal TI0: . ENTRY CONDITIONS R0 -> DATA STRING FOR OUTPUT EXIT CONDITIONS CHARACTERS ARE DISPLAYED ON THE TERMINAL TI0: V$INPUT MG03 This procedure reads a character string from the terminal TI0: . ENTRY CONDITIONS ENTRY ADDRESS +0 READ WITH ECHO ENTRY ADDRESS +2 READ NO ECHO EXIT CONDITIONS R0 -> THE INPUTTED DATA STRING Terminal input/output routines PAGE 54 NAME MODULE DESCRIPTION ---- ------ ----------- V$ON MG08 This procedure assigns V$LUN to the terminal. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR V$OFF MG08 This procedure deassigns the terminal lun. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR V$TERMINAL MG08 This procedure switches the VDU channel back to the users terminal. ENTRY CONDITIONS NONE EXIT CONDITIONS If the operation fails the programme will HALT V$CHANNEL MG08 This procedure set up the location V$DUNT to the device channel required to be exchanged for the VDU channel. ENTRY CONDITIONS R0 = THE DEVICE CHANNEL NUMBER EXIT CONDITIONS NONE Terminal input/output routines PAGE 55 NAME MODULE DESCRIPTION ---- ------ ----------- V$DEVICE MG08 This procedure switches the VDU channel to a device selected by the locations V$DUNT the device unit number and the locations V$DDEV the device code letters. The standard default code letters are "TT" and the unit number is zero the unit number may be altered by the procedure V$CHANNEL. To prepare channel TT56: the following sequence would be used :- MOV #56,R0 ;Hold channel number CALL V$CHANNEL ;Load new channel number CALL V$DEVICE ;Switch the channel Note once the channel number has been set up there should be no need to reuse the procedure V$CHANNEL unless the channel is to be changed. ENTRY CONDITIONS LOCATIONS V$DUNT AND V$DDEV ARE SET UP EXIT CONDITIONS STATUS = SUCCESS OR ERROR IF STATUS = ERROR THEN THE CHANNEL IS RETURNED BACK TO THE VDU CHANNEL V$SWITCH MG08 This procedure reassigns the terminal channel to some other peripherial as specified by the locations V$UNIT and V$DEV . ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR Terminal input/output routines PAGE 56 NAME MODULE DESCRIPTION ---- ------ ----------- V$TXA MG09 This proceduure enables an alternative method of passing data to the V$TX procedure. The format of this call is :- CALL V$TXA Address of string to be output ENTRY CONDITIONS STRING ADDRESS FOLLOWS CALL EXIT CONDITIONS DATA OUTPUT TO TERMINAL V$TXB MG10 This procedure enables an alternative method of passing data to the procedure V$TX. The format of this call is :- CALL V$TXB length of character string character string ENTRY CONDITIONS STRING DATA FORMAT FOLLOWS THE CALL STATEMENT EXIT CONDITIONS CHARACTERS ARE DISPLAYED ON THE TERMINAL. Terminal input/output routines PAGE 57 NAME MODULE DESCRIPTION ---- ------ ----------- V$TXC MG11 This procedure enables repeats of a character to be sent to the terminal. The data follows the call to this procedure. The format of this call is :- CALL V$TXC .BYTE repeat count value in range 1 to 255 .BYTE character to be transmitted to the terminal. ENTRY CONDITIONS DATA FOLLOWS PROCEDURE CALL EXIT CONDITIONS CHARACTERS ARE DISPLAYED ON THE TERMINAL. V$TXD MG12 This procedure enables an alternative method of passing data to the procedure V$TX. The format of this call is :- CALL V$TXD maximun string length (protection word) length of character string character string ENTRY CONDITIONS STRING DATA FORMAT FOLLOWS THE CALL STATEMENT EXIT CONDITIONS CHARACTERS ARE DISPLAYED ON THE TERMINAL. CHAPTER 5 CHARACTER/STRING MANIPULATION ROUTINES USING CD.DIC. INDEX 1 INTRODUCTION PAGE 59 2 CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 60 INTRODUCTION PAGE 59 These subroutines use labels in which to pass the parameters. All registers are saved across the call. The locations are all words and are found in Module MGD03. They are as follows:- CD.SRC Address of main string (source) or table entry address. CD.DST Address of secondary string (destination). CD.CHR Contains the fill or operation character. CD.CNT Contains the last input numeric count. CD.POS Holds the character or string position to find or found. CD.RES Contains the result of a previous macro (eg- COMPARE). CD.KEY Holds the last table key entry that was accessed. The above locations are known as the COMMON DICTIONARY (CD.DIC) and may be modified as required. NOTE:- that the table macros also use the COMMON DICTIONARY, and that after saving and setting the registers these routines call the appropriate register routine. Thus L$GETC calls R$GETC. CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 60 NAME MODULE DESCRIPTION ---- ------ ----------- L$GETC MLC01 EXTRACT A CHARACTER FROM A STRING. ENTRY CONDITIONS CD.SRC -> STRING TO PROCESS. CD.POS = CHARACTER POSITION TO EXTRACT. EXIT CONDITIONS CD.CHR = EXTRACTED CHARACTER. EXITERROR IF INVALID CONDITIONS. L$MODC MLC02 REPLACE A CHARACTER IN A STRING. ENTRY CONDITIONS CD.CHR = REPLACEMENT CHARACTER CD.SRC -> CHARACTER STRING ADDRESS CD.POS = CHARACTER POSITION TO MODIFY EXIT CONDITIONS EXITERROR IF INVALID CONDITIONS. L$ADDC MLC03 APPEND A CHARACTER TO A STRING. ENTRY CONDITIONS CD.CHR = CHARACTER TO ADD TO STRING. CD.SRC -> CHARACTER STRING. EXIT CONDITIONS. ERROREXIT IF INVALID CHARACTER. CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 61 NAME MODULE DESCRIPTION ---- ------ ----------- L$INSC MLC04 INSERT A CHARACTER IN A STRING. ENTRY CONDITIONS. CD.CHR = CHARACTER TO INSERT CD.SRC -> STRING ADDRESS. CD.POS = CHARACTER POSITION. EXIT CONDITIONS. ERROREXIT IF INVALID CONDITIONS. L$DELC MLC05 DELETE A CHARACTER WITHIN A STRING. ENTRY CONDITIONS CD.SRC -> STRING ADDRESS CD.POS = CHARACTER POSITION TO DELETE EXIT CONDITIONS ERROREXIT IF INVALID CONDITIONS. L$POSC MLC06 LOCATE POSITION OF CHARACTER IN STRING. ENTRY CONDITIONS CD.CHR = CHARACTER TO LOCATE. CD.SRC -> ADDRESS OF STRING. CD.POS = START POSITION TO START SEARCH IN STRING. EXIT CONDITIONS CD.POS = UNCHANGED IF CHARACTER NOT FOUND (EXITERROR). CD.POS = CHARACTER POSITION (EXITSUCCESS). CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 62 NAME MODULE DESCRIPTION ---- ------ ----------- L$MOVC MLC07 EXTRACT A CHARACTER FROM A STRING. ENTRY CONDITIONS CD.SRC -> STRING ADDRESS EXIT CONDITIONS CD.CHR = CHARACTER IF STATUS EQUALS SUCCESS. L$CMPC MLC09 COMPARE TWO CHARACTERS. ENTRY CONDITIONS. CD.CHR = FIRST CHARACTER (BYTE) CD.CHR+1 = SECOND CHARACTER (BYTE) EXIT CONDITIONS. SUCCESS IF CHARACTERS ARE THE SAME. L$ADDS MLC12 ADD ONE STRING TO ANOTHER STRING. ENTRY CONSITIONS. CD.SRC -> CHARACTER STRING TO ADD. CD.DST -> CHARACTER STRING TO BE ADDED TO. EXIT CONDITIONS. ERROREXIT IF INVALID CONDITIONS. L$DELETE ML04 CHARACTER DELETE WITHIN A STRING. ENTRY CONDITIONS CD.SRC -> STRING TO PROCESS CD.POS = START POSITION WHERE DELETING IS TO START. CD.CNT = NUMBER OF CHARACTERS TO DELETE. EXIT CONDITIONS NONE CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 63 NAME MODULE DESCRIPTION ---- ------ ----------- L$POS3 ML05 POSITION ROUTINE, 3 PARAMETERS. ENTRY CONDITIONS. CD.SRC -> MASTER STRING CD.DST -> SEARCH STRING CD.POS = START POSITION OF SEARCH. EXIT CONDITIONS CD.POS = POSITION OF FIRST CHARACTER IF MATCH FOUND.(SUCCESS) CD.POS = '0' IF NO MATCH FOUND. (ERROR) L$POS2 ML05 POSITION ROUTINE, 2 PARAMETERS. ENTRY CONDITIONS. CD.SRC -> MASTER STRING CD.DST -> SEARCH STRING EXIT CONDITIONS CD.POS = POSITION OF FIRST CHARACTER IF MATCH FOUND.(SUCCESS) CD.POS = '0' IF NO MATCH FOUND.(ERROR) L$WEDGE ML06 WEDGE ONE STRING WITHIN ANOTHER STRING. ENTRY CONDITIONS CD.DST -> MASTER STRING ADDRESS. CD.SRC -> WEDGE STRING ADDRESS. CD.POS = POSITION WHERE INSERT MUST START. EXIT CONDITIONS. NONE CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 64 NAME MODULE DESCRIPTION ---- ------ ----------- L$REVERSE ML07 STRING REVERSAL PROCEDURE. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING TO BE REVERSED. EXIT CONDITIONS NONE L$SHRE ML08 CHARACTER SHIFT RIGHT END AROUND. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. EXIT CONDITIONS NONE L$SHLE ML09 CHARACTER SHIFT LEFT END AROUND. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. EXIT CONDITIONS NONE L$SHR ML10 SHIFT CHARACTER STRING ONE PLACE RIGHT. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. CD.CHR = FILLER CHARACTER. EXIT CONDITIONS NONE CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 65 NAME MODULE DESCRIPTION ---- ------ ----------- L$SHL ML10 SHIFT CHARACTER STRING ONE PLACE RIGHT. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. EXIT CONDITIONS NONE L$COMPARE ML11 COMPARE TWO CHARACTER STRINGS. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. CD.DST -> CHARACTER STRING ADDRESS. EXIT CONDITIONS IF BOTH STRING IDENTICAL CD.RES = ZERO (SUCCESS) IF SOURCE STRING LARGEST CD.RES = POSITIVE (ERROR) IF DESTINATION STRING LARGEST CD.RES = NEGATIVE (ERROR) NOTE:- WHEN STRINGS OF DEFFERING LENGTHS ARE SUPPLIED THE CHARACTERS ARE COMPARED OVER THE LENGTH OF THE SHORTEST STRING, IF ALL CHARACTERS ARE THE SAME THE SHORTEST STRING IS ASSUMED TO BE THE SMALLER. CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 66 NAME MODULE DESCRIPTION ---- ------ ----------- L$ADDTO ML12 ADD ONE STRING TO ANOTHER. ENTRY CONDITIONS CD.SRC -> STRING TO APPEND. CD.DST -> CHARACTER STRING TO BE APPENDED TOO. EXIT CONDITIONS NONE L$CLEAR ML13 CLEAR OUT A CHARACTER STRING. ENTRY CONDITIONS CD.SRC -> CHARACTER STRING ADDRESS. EXIT CONDITIONS NONE L$SEG ML14 EXTRACT SEGMENT OF A CHARACTER STRING. ENTRY CONDITIONS CD.SRC -> INPUT STRING ADDRESS. CD.POS -> START POSITION. CD.CNT -> NUMBER OF CHARACTERS. CD.DST -> OUTPUT CHARACTER STRING ADDRESS. EXIT CONDITIONS CD.DST -> OUTPUT STRING ADDRESS. CHARACTER PROCEDURES USING COMMON DICTIONARY. PAGE 67 NAME MODULE DESCRIPTION ---- ------ ----------- L$PAD ML16 PAD A CHARACTER STRING. ENTRY CONDITIONS CD.SRC -> INPUT STRING ADDRESS. CD.CNT = NUMBER OF CHARACTERS TO PAD WITH OR '0' FOR REST OF STRG. CD.CHR = CHARACTER TO PAD WITH. EXIT CONDITIONS NONE CHAPTER 6 Node manipulation routines INDEX 1 Introduction PAGE 69 2 Node routines PAGE 70 3 Node table generation MACRO and data formats PAGE 73 Introduction PAGE 69 A node in this context is a block of memory which may be accessed as a fixed or variable length data area controlled within a limited area of program memory. The node software is suitable as the basis for editors interpreters screen formatting and sorting programs and various other data manipulation software. Node routines PAGE 70 NAME MODULE DESCRIPTION ---- ------ ----------- N$DIAG MN01 This procedure prints onto the terminal the state of the control nodeblock data table. ENTRY CONDITIONS LUN ONE ASSIGNED TO THE TERMINAL EXIT CONDITIONS NONE N$DUMP MN02 This procedure prints onto the terminal the contents of the present node the next sequential nodes as specified by a count value in R0. ENTRY CONDITIONS LUN ONE ASSIGNED TO THE TERMINAL R0 = NUMBER OF SEQUENTIAL NODES TO DUMP EXIT CONDITIONS NONE N$INIT MN03 This procedure sets up the node control block to access a new node table. If a node table is being processed the old data is copied back to old node table before new data copied in. ENTRY CONDITIONS R0 -> ADDRESS OF NODE TABLE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY N$CREATE MN09 This procedure will try to create a node in the node table. ENTRY CONDITIONS R0 = SIZE IN BYTES REQUIRED BY NODE R1 = MARKERS TO LOCATE NODE WITH EXIT CONDITIONS R0 -> NEW NODE ACCESS ADDRESS IF STATUS = SUCCESS Node routines PAGE 71 NAME MODULE DESCRIPTION ---- ------ ----------- N$DELETE MN06 This procedure will try to delete a node in the node table. ENTRY CONDITIONS R1 = MARKER TO LOCATE NODE WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NEXT NODE IF STATUS = SUCCESS N$PROTECT MN08 This procedure disables the delete procedure from deleting a node and when a node is used as a character string the string is marked write protect. ENTRY CONDITIONS R1 = MARKER OF NODE TO PROTECT EXIT CONDITIONS R0 -> ACCESS ADDRESS OF PROTECTED NODE IF STATUS = SUCCESS N$UNPROTECT MN08 This procedure removes any protect flags set on a node. ENTRY CONDITIONS R1 = MARKERS TO LOCATE NODE WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NODE IF STATUS = SUCCESS N$SEEK MN04 This procedure locates the position in the node table of a specified node. ENTRY CONDITIONS R1 = MARKERS TO LOCATE NODE WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NODE IF STATUS = SUCCESS N$SQUEEZE MN10 This procedure compresses the node table removing any nodes marked for delete. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY Node routines PAGE 72 NAME MODULE DESCRIPTION ---- ------ ----------- N$FIRST MN05 This procedure locates the first node in the node table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF FIRST NODE IF STATUS = SUCCESS N$LAST MN05 This procedure locates the last node in the node table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF LAST NODE IF STATUS = SUCCESS N$PRESENT MN05 This procedure locates the position of the node presently being pointed at in the node table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF PRESENT NODE IF STATUS = SUCCESS N$SETUP MN05 This procedure verifys that the node table has been set up by the N$INIT routine. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY N$NEXT MN07 This procedure steps onto the next node in the node table, nodes are assumed to end wrap around no checks are made regarding the state of the node. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NEXT NODE IF STATUS = SUCCESS Node table generation MACRO and data formats PAGE 73 NODEBLOCK [number of bytes in table] This macro is used at least twice. The macro is specified once without the number of bytes being specified this macro then expands all the global symbols required for the correct operation of the node control software. All further uses of the NODEBLOCK macro are used to create node tables. NODE FORMAT ----------- BYTES 0,1 Location of marker word BIT 15 indicates the node is deleted. BYTES 2,3 Maximum size in bytes of the node. BIT 15 SET indicates this node is protected BYTES 4,5 Free byte or indicates length when node is a string. BYTES 6-> User workspace in node CHAPTER 7 Table manipulation routines INDEX 1 Introduction PAGE 75 2 Table routines PAGE 76 3 Entry table generation MACRO and data structures PAGE 81 Introduction PAGE 75 A table in this context is a block of memory which may be accessed as a fixed or variable length data area controlled within a limited area of program memory. It differs from the node software in that the key is held in sorted order in an internal string, thus all table lookups and creates are automatically put in key order. NOTE:- 1. no key may be greater than 32766 (Octal 77776). 2. an allowance must be made in the length declaration for the sort string of approximately 12 bytes for each required string. The table software is suitable as the basis for editors interpreters screen formatting and sorting programs and various other data manipulation software. Table routines PAGE 76 NAME MODULE DESCRIPTION ---- ------ ----------- T$DIAG MT01 This procedure prints onto the terminal the state of the control data table. ENTRY CONDITIONS LUN ONE ASSIGNED TO THE TERMINAL EXIT CONDITIONS NONE T$DUMP MN02 This procedure prints onto the terminal the contents of the present entry the next sequential entrys as specified by a count value in R0. ENTRY CONDITIONS LUN ONE ASSIGNED TO THE TERMINAL R0 = NUMBER OF SEQUENTIAL ENTRYS TO DUMP EXIT CONDITIONS NONE T$INIT MT03 This procedure sets up the entry control block to access a new table. If a entry table is being processed the old data is copied back to old entry table before new data copied in. ENTRY CONDITIONS R0 -> ADDRESS OF TABLE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY Table routines PAGE 77 NAME MODULE DESCRIPTION ---- ------ ----------- T$CREATE MT09 This procedure will try to create an entry in the table. ENTRY CONDITIONS R0 = SIZE IN BYTES REQUIRED BY ENTRY R1 = MARKERS TO LOCATE ENTRY WITH EXIT CONDITIONS R0 -> NEW ENTRY ACCESS ADDRESS IF STATUS = SUCCESS T$SCHK MT09 This procedure is used by T$CREATE to check if sort table string can be inserted. DO NOT USE. T$IKEY MT09 This procedure is NOT TO BE USED on its own. It is used by T$CREATE to insert an item in the sort string ENTRY CONDITIONS R0 = ADDRESS OF STRING. EXIT CONDITIONS R0 = ACCESS ADDRESS IF SUCCESS. T$DELETE MT06 This procedure will try to delete an entry in the table. ENTRY CONDITIONS R1 = MARKER TO LOCATE ENTRY WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NEXT ENTRY IF STATUS = SUCCESS T$DKEY MT06 This procedure is NOT TO BE USED on its own. It is used by T$DELETE to remove item from the sort string ENTRY CONDITIONS (set up by T$DELETE) EXIT CONDITIONS (same as T$DELETE) Table routines PAGE 78 NAME MODULE DESCRIPTION ---- ------ ----------- T$PROTECT MT08 This procedure disables the delete procedure from deleting an entry and when an entry is used as a character string the string is marked write protect. ENTRY CONDITIONS R1 = MARKER OF ENTRY TO PROTECT EXIT CONDITIONS R0 -> ACCESS ADDRESS OF PROTECTED ENTRY IF STATUS = SUCCESS T$UNPROTECT MT08 This procedure removes any protect flags set on an entry. ENTRY CONDITIONS R1 = MARKERS TO LOCATE ENTRY WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF ENTRY IF STATUS = SUCCESS T$SEEK MT04 This procedure locates the position in the entry table of a specified entry. ENTRY CONDITIONS R1 = MARKERS TO LOCATE ENTRY WITH EXIT CONDITIONS R0 -> ACCESS ADDRESS OF ENTRY IF STATUS = SUCCESS T$SQUEEZE MT10 This procedure compresses the table removing any entrys marked for delete, and rebuilds the sort string. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY T$SORT MT10 This procedure compresses the table removing any entrys marked for delete, and rebuilds the sort string. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY Table routines PAGE 79 NAME MODULE DESCRIPTION ---- ------ ----------- T$FIRST MT05 This procedure locates the first sorted entry in the table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF FIRST SORTED ENTRY IF STATUS = SUCCESS T$LAST MT05 This procedure locates the last sorted entry in the table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF LAST SORTED ENTRY IF STATUS = SUCCESS T$PRESENT MT05 This procedure locates the position of the entry presently being pointed at in the table. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF PRESENT ENTRY IF STATUS = SUCCESS T$SETUP MT05 This procedure verifys that the entry table has been set up by the T$INIT routine. ENTRY CONDITIONS NONE EXIT CONDITIONS STATUS = SUCCESS OR ERROR ONLY Table routines PAGE 80 NAME MODULE DESCRIPTION ---- ------ ----------- T$NEXT MT07 This procedure steps onto the next entry in the table. If the routine attempts to step beyond the last entry, it will exit with an error and the address of the last entry. ENTRY CONDITIONS NONE EXIT CONDITIONS R0 -> ACCESS ADDRESS OF NEXT ENTRY IF STATUS = SUCCESS R0 -> ACCESS ADDRESS OF LAST ENTRY IF STATUS = ERROR. T$PREVIOUS MT07 This procedure steps back to the previous entry in the table.If the routine attempts to step beyond the first entry it will exit with an error and the address of the first entry. ENTRY CONDITIONS. none EXIT CONDITIONS. R0 -> ACCESS ADDRESS OF PREVIOUS ENTRY IF STATUS = SUCCESS R0 -> ACCESS ADDRESS OF FIRST ENTRY IF STATUS = ERROR T$RSEQ MT11 This procedure resequences the keys in a table. Thus if the resequence point is '3' then keys '1' and '2' will remain untouched, key '3' will become '4' and '4' will become '5' etc. If the resequence point is '0', then all keys will be sequentially resequenced starting at '1'. ENTRY CONDITIONS R0 -> ADDRESS OF RESEQUENCE POINT IN SORT STRG. MOV TPRESENT,R0 ;makes hole. CLR R0 ;complete resequence. EXIT CONDITIONS EXITSUCCESS ONLY. Entry table generation MACRO and data structures PAGE 81 TABLEBLOCK This macro sets up the common 'TABLE/NODE' area and must only be specified once within a program. When specified this macro then expands all the global symbols required for the correct operation of the entry control software. All further uses of the ENTRYBLOCK macro are used to create entry tables. NOTE:- It is important to realise that 'TABLEBLOCK' is the same as 'NODEBLOCK' (with no size param), their action is identical and only one or other should be specified once. TABLE [Total number of bytes required in table] This macro defines the size of the Table, and is called once for each table required. It must be preceeded by a label with which it can be referenced ENTRY FORMAT ----------- BYTES 0,1 Location of marker word, MUST BE LESS THAN 32766 (O'77776). BIT 15 indicates the entry is deleted. BYTES 2,3 Maximum size in bytes of the entry. BIT 15 SET indicates this entry is protected BYTES 4,5 Free byte or indicates length when entry is a string. BYTES 6-> User workspace in entry CHAPTER 8 Device channel routines INDEX 1 Magnetic tape routines General information PAGE 83 2 Magnetic tape routines Data area functions PAGE 84 3 Magnetic tape routines Procedure functions PAGE 85 Magnetic tape routines General information PAGE 83 GENERAL INFORMATION =================== Use of the magnetic tape controller ----------------------------------- This software uses a series of reserved data locations to indicate which magnetic tape controller is to be used. These locations may be altered or examined to switch channels or to observe the effects of data transfer error etc.. Magnetic tape routines Data area functions PAGE 84 NAME MODULE FUNCTION ---- ------ -------- MT$UNIT MMTD0 This location indicates which controller is to be opened by the OPEN call. [default = unit number 0 ie. MM0: ] MT$LUN MMTD0 This location indicates which logical unit will be assigned to the magnetic tape controller. [default = lun 2] MT$EFN MMTD0 This location indicates which event flag will be used for I/O operations etc. [default = event flag 2] MT$DSW MMTD0 This location hold the status of the last I/O operation. MT$ISB MMTD0 This is the address of the INPUT/OUTPUT STATUS block. Magnetic tape routines Procedure functions PAGE 85 NAME MODULE DESCRIPTION ---- ------ ----------- MT$EXIT MMT01 This procedure is the general exit routine for the magnetic tape input output control routines. ENTRY CONDITIONS This routine is entered via a jump or branch order just after an I/O operation has occured in order to save the DSW and return to the calling program. EXIT CONDITIONS status flag = success or error MT$GET MMT02 This procedure reads a block of data from the magnetic tape controller. ENTRY CONDITIONS R0 -> string address EXIT CONDITIONS status = success or error MT$SHUT MMT03 This procedure closes down the magnetic tape channel being used. ENTRY CONDITIONS none EXIT CONDITIONS status = success or error MT$PUT MMT04 This procedure writes a block of data to the magnetic tape controller. ENTRY CONDITIONS R0 -> string address EXIT CONDITIONS status = success or error Magnetic tape routines Procedure functions PAGE 86 NAME MODULE DESCRIPTION ---- ------ ----------- MT$OPEN MMT05 This procedure opens up a magnetic tape controller channel. ENTRY CONDITIONS none EXIT CONDITIONS Status = success or error MT$FIND MMT06 This procedure finds the next end of file marker on the magnetic tape. ENTRY CONDITIONS none EXIT CONDITIONS Status = success or error MT$BACK MMT07 This procedure requests the magnetic tape controller to backspace one block on the present magnetic tape. ENTRY CONDITIONS none EXIT CONDITIONS Status = success or error MT$REWIND MMT08 This procedure requests the magnetic tape controller to rewind the present magnetic tape. ENTRY CONDITIONS none EXIT CONDITIONS Status = success or error MT$MARK MMT09 This procedure marks the tape with an end of file mark. ENTRY CONDITIONS none EXIT CONDITIONS Status = success or error CHAPTER 9 Message checking routines. INDEX 1 Introduction and routines. PAGE 88 2 Data structures and generation macros. PAGE 89 Introduction and routines. PAGE 88 These routines macros were developed to check and validate input messages with as little software effort as possible. NAME MODULE DESCRIPTION ---- ------ ----------- M$CHECK MMC01 This procedure compares an input message with a selected message table and reply -1 if the message/keyword is not found. ENTRY CONDITIONS R0 -> MESSAGE TO BE VALIDATED R1 -> ADDRESS OF A MESSAGE TABLE EXIT CONDITIONS R0 = -1 IF MESSAGE/KEYWORD NOT FOUND R0 = REPLY VALUE IF MESSAGE/KEYWORD FOUND M$HUNT MMC02 This procedure uses the data structure set up by the macro REPORT to use a binary value to ascociate it with a text message hence giving a simple method of relating error reports to plain language messages. ENTRY CONDITIONS R0 = BINARY VALUE TO BE LOCATED R1 -> ADDRESS OF A REPORT TABLE EXIT CONDITIONS IF STATUS = SUCCESS R0 = ADDRESS OF TEXT IF STATUS = ERROR R0 = 0 Data structures and generation macros. PAGE 89 Message table generating macro. ------------------------------- MODULE NAME DESCRIPTION ------ ---- ----------- MX02 MESSAGE [minimum characters for match,reply value,check string] This macro set up an entry in a message table. If no parameter is specified this indicates the message table terminator. The reply value can be any integer value except the value -1. This field could be set up to contain a series of switch jump values to enable automatics command line processing. The minimum characters for match field enables this routine to distinguish between say the words XXXz and XXXy when only three characters have been input. The string is the group of characters you wish to locate as an answer. Note the start of the message table is indicated by setting a label just before the first occurance of the macro MESSAGE. for example TABSTART: MESSAGE 1,55,"RUBBISH" MESSAGE ;END OF TABLE MX02 REPORT [CONTROL CODE, HUNT VALUE, TEXT STRING] This macro sets up an entry in the REPORT table. If no parameter is specified this acts as the report table terminator and must be used once at the end of every report table. The HUNT VALUE may be any value including symbolic offsets and DSW error reports in symbolic form. The CONTROL CODE is normally defaulted as this is only used to create text strings that exceede one printed line. When an extended string is generated the macro automaticaly inserts a line feed , carriage return at the start of each continuation line and on the last line. The permisiable CONTROL CODES are FIRST CONT LAST The code FIRST indicates the start of the message CONT indicates a continuation line and LAST is the last line of the report text. example report table generation. REPORT ,IE.SUC,<"Success status"> REPORT START,207.,<"Oh Dear"> REPORT CONT,,<"Something has gone wrong"> REPORT LAST,,<"try pressing the RETURN key"> REPORT ;REPORT TERMINATOR CHAPTER 10 Stand alone Serial device line handler/driver. INDEX 1 Introduction PAGE 91 2 Building and usage PAGE 92 3 PARAMETER OPTIONS PAGE 94 4 DEVICE FLAG BITS PAGE 95 Introduction PAGE 91 DEVIO MACRO DEVICE Input Output controler routine. ================***====*=====*======================== This is a customed designed general purpose serial line device driving routine created by a common MACRO 11 macro. The DEVIO macro enables the user to develop an absolute app- lication device driver from a single line of MACRO code. DEVIO allows you to specify the following options :- Option Default Remarks ====== ======= ======= (1) none The interupt vector address. (2) none The base control and status registers address. (3) none A one or two letter/number identifier for multiply routines. (4) STRING The mode of transfer of the output section. (5) CHAR The mode of transfer of the input section. (6) 8 The number of characters allowed in the read ahead buffer (7) 0 The number of filler character to follow a line feed sequence. (8) strip The condition of the parity bit on input. (9) ON Auto-matic character echo option (10) YES Input code required ? (11) YES Output code required ? (12) TERM If handler to behave as terminal or device. (13) SMART If smart (VDU) erase option required. (14) ESC If ESCAPE is allowed to terminate a string (if selected). (15) 0 Size of input string buffer. Building and usage PAGE 92 Depending on the parameters declared a selection of the foll- owing labels will be available. For compatablility with 'SERIO' - SOUT'aa' equates to OUTS'aa' OUTC'aa' SINP'aa' equates to INPS'aa' INPC'aa' SINT'aa' equates to DINT'aa' DEVICE LABELS - ============= DFLG'aa' Flag storage location.(see next topic) DINT'aa' Device initialisation routine. INPS'aa' String input. (R0 holds address.) INPC'aa' Character input. (R0 holds the character.) OUTS'aa' string output. (R0 holds address.) OUTC'aa' character output. (R0 holds the character.) SSIZ'aa' Holds input buffer size. Building and usage PAGE 93 CALLING :- 'DEVIO' (and 'SERIO') must be defined as required, this definition can be carried by 'CONFIG' instead. USE :- .MCALL DEVIO DEVIO P1,P2,P3,,P5,P6,P7,P8 - see parameter options and note that 'P4' is a multiple parameter field. eg:- DEVIO KB,176500,60,,32 - note that the last three parameters are not req- uired and so are left blank. PROGRAM CALLS :- - In the above "CALL INPC'aa'" is "CALL INPCKB" ('aa') denotes the channel identifier. Character mode - R0 holds the character. String mode - R0 holds the string address. ERROR RETURN :- On input means that no character or string has been received. NOTE :- In non-buffered string output, the string must not be changed untill the output has finished. (Check bit 6 of the flag word (DFLGKB)),. PARAMETER OPTIONS PAGE 94 PARAM DEFAULT OPTION DETAILS ===== ======= ====== ======= P1 NONE 'aa' The channel identifier - any two alpha numeric characters which form the last two character of any label, eg:- 01 or AA. (see calling information) P2 NONE - The base 'CSR' address - eg:- 176500 P3 NONE - The base vector address - eg:- 60 P4 Multiple parameter field where some or all of the options may be selected, seperated by a ',' and surrounded by argument indicators. OSTRING OCHAR The mode of transfer to the output section. ICHAR ISTRING The mode of transfer from the input section. PARITY NOPAR Parity bit stripping option. INPUT NOIN Appropriate input code generation. OUTPUT NOOUT Appropriate output code generation. TERM DEVICE Set it as a terminal or a device handler. ECHO NOECHO Auto echo option. * ESCAPE NOESCAPE Escape sequence option. * SCOPE NOSCOPE Smart scope funtion option. (erase function) * TAB NOTAB Horizontal tab option. (not yet implemented) * FF NOFF Form feed option. (FF to LF's) (not implemented * P5 8 'num' Read ahead buffer size. P6 0 'num' Input string buffer size (if 'ISTRING' defined). P7 0 'num' Number of filler characters required after a Line feed. * P8 0 'num Output ring buffer size. Note:- * denotes terminal handler only options. DEVICE FLAG BITS PAGE 95 BIT Function === ======== 0 = 1 Handler requires re-initialising. 1 Not used 2 Not used 3 = 1 Disable the output section. 4 * 'Internal use' (CRLF) 5 * 'Internal use' (CNTR'R) 6 = 1 * Transmitter section is busy 7 = 1 * Input characters have been lost. 8 = 1 * Escape character terminated the last string 9 * 'internal use' ('NOINC' tx pointer) 10 = 1 * 'internal use' (filler output required) 11 = 1 * 'internal use' (input echo buffer busy) 12 = 1 * This handler is a terminal handler 13 = 1 Smart scope is enabled. 14 = 1 Read no echo function enabled. 15 = 1 Do not strip input parity bit. Treat all flags marked with an * character as READ ONLY setting or clearing other flags may cause unpredictable results other than those indicated above. CHAPTER 11 Stand alone Serial line device handler/driver. INDEX 1 Introduction PAGE 97 2 Building and usage PAGE 98 Introduction PAGE 97 SERIO MACRO SERial Input Output controler routine. ================***====*=====*======================== This is a customed designed general purpose serial line device driving routine created by a common MACRO 11 macro. The SERIO macro enables the user to develop an absolute application device driver from a single line of MACRO code. SERIO allows you to specify the following options :- Option Default Remarks (1) none The interupt vector address. (2) none The base control and status registers address. (3) none A one or two letter/number identifier for multiply routines. (4) STRING The mode of transfer of the output section. (5) CHAR The mode of transfer of the input section. (6) 8 The number of characters allowed in the read ahead buffer (7) 0 The number of filler character to follow a line feed sequence. (8) strip The condition of the parity bit on input. (9) ON Auto-matic character echo option (10) YES Input code required ? (11) YES Output code required ? (12) TERM If handler to behave as terminal or device. (13) SMART If smart (VDU) erase option required. (14) ESC If ESCAPE is allowed to terminate a string (if selected). (15) 0 Size of input string buffer. Building and usage PAGE 98 SERIO Created routines have :- Three entry points Entry point +0 Output a string/character Entry point +2 Input a string/character Entry point +4 Initialise package Start address +6 contains the control flagword and the flags may be accessed to observe the state of the control handler. Where :- The following flags may be of use BIT Function 0 = 1 Handler requires re-initialising. 3 = 1 Disable the output section. 6 = 1 * Transmitter section is busy 7 = 1 * Input characters have been lost. 8 = 1 * Escape character terminated the last string 12 = 1 * This handler is a terminal handler 13 = 1 Smart scope is enabled. 14 = 1 Read no echo function enabled. 15 = 1 Do not strip input parity bit. Treat all flags marked with an * character as READ ONLY setting or clearing other flags may cause unpredictable results other than those indicated above. At location Start address +8 (Only when string input selected) holds a count of maximum number of characters to be read to terminate string if an escape or line feed sequence is not detected. By default this value is set to input string maximum size. Building and usage PAGE 99 How to use the SERIO macro. .MCALL SERIO SERIO p1,p2,p3,,p5,p6,p7,p8 Where :- p1 Is the channel identifier ie. 01 or AA p2 Is the base CSR address ie. 176500 p3 Is the base Vector address ie. 300 p4 Is a multiple parameter field where some or all of the following options may be selected seperated by commas. NOECHO disable auto echo option NOESCAPE disable escape sequence option NOSCOPE disable smart scope function NOIN remove input code generation NOOUT remove output code generation NOPAR disable parity stripping option DEVICE remove terminal handling functions STRING indicate input section recives data in string form OCHAR indicate output section recives data in character form p5 Is the read-ahead buffer size p6 Is the input string buffer size p7 Is the number of filler characters after line feed sequence p8 Is the output buffer size (NOT incorporated) USAGE:- ----- CALL SINP** ;(** - is the channel identifier) IF SUCCESS -character mode. R0 = ascii character. -string mode. R0 -> string address. IF ERROR -no input. (buffer empty) CALL SOUT** -character mode. R0 = ascii character. !!! -string mode. R0 -> string address. !!! 'DON'T' alter the buffer until output finished (check bit 6). CHAPTER 12 MACROS FOR SYSTEM CONFIGURATION AND SERIAL IO DEFINITIONS. INDEX 1 SYSTEM CONFIGURATION PAGE 101 2 STANDARD DEFINITIONS. PAGE 103 3 MACRO LIBRARY PAGE 104 SYSTEM CONFIGURATION PAGE 101 MACROS FOR SYSTEM CONFIGURATION AND SERIAL IO DEFINITIONS. ********************************************************** AUTHOR :- J.S.CLIFTON DATE :- 21st SEPTEMBER 82. CONFIG MACRO. ************* This macro sets the system configuration, namely the machine that the program will run on, the operating system it will use, the Macro group that will be defined and standard constants if required. It will be called at the beginning of the program, or in the 'prime' module. The parameters may be specified in any order, and if not specified then the default parameters will be assumed. The call is of the form:- .MCALL CONFIG CONFIG "machine","op.sys","macros","list flg","std defs","trace flg " PDP70 IAS BASMAC LIST DEFS TRACE LSI03 RT11 IOMACS NOLIST NODEFS NOTRACE LSI23 ALONE STGMAC TBLMAC SUPMAC DTBMAC RTMACS NOMACS SERIO DEVIO Machine:- This defines the machine that the program is to run on. Operating Sys:- This gives the operating system that the ma- chine will be using, note that ALONE means in the STAND ALONE mode on an LSI machine and the output routines will be built accord -ingly. Default:- If Config is defined on its own then the following default parameters will apply. PDP70,IAS,NOMACS,NOLIST,NODEFS,NOTRACE NOTE:- Parameters may be put in any order and more than one set of Macros may be included. SYSTEM CONFIGURATION PAGE 102 Macros:- Different levels of Macros can be easily def -ined for different jobs. Note that Macro calls of a higher level will automatically generate some lower level macro calls. BASMAC - A limited number of macros for simple macro programming. IOMACS - This includes all the macros designed for IO includeing those in BASMAC. STGMAC - The basic set of string handling macros - including those in BASMAC. TBLMAC - This includes all the 'NODE' and 'TABLE' macros plus STGMAC and BASMAC. SUPMAC - These are the SUPER-MAC macros and include STGMAC and BASMAC. DTBMAC - This includes all the 'DECISION TABLE' macros plus SUPMAC, STGMAC and BASMAC. RTMACS - This calls the RT11 macros for test build purposes only, it does not automatically include any other macros. SERIO - Serial input/output macro. DEVIO - Device serial input/output macro. (Similar to 'serio'). NOTE - A few very special purpose macros are not defined by this macro, see the table below. BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RTMACS ****** ****** ****** ****** ****** ****** ****** BASMAC X IOMACS X X STGMAC X X TBLMAC X X X SUPMAC X X X DTBMAC X X X X ALLMAC X X X X X X RTMACS X STANDARD DEFINITIONS. PAGE 103 Table of 'STANDARD DEFINITIONS' defined by 'CONFIG'. ==================================================== Operating System. ================= RT11 = 1 IAS = 2 ALONE = 4 OPSYS = 'Defines the Operating System.' 'DEC' Machine. ============== PDP70 = 70 LSI03 = 0 LSI23 = 23 MACHINE = 'One of the above defines machine' Standard Definitions. ===================== NULL = 0 STX = 2 Start of text. ETX = 3 End of text. EOT = 4 End of transfer. CNTC = 'C-100 Control characters. CNTD = 'D-100 CNTZ = 'Z-100 TAB = 11 Tabulation character. HT = TAB LF = 12 Value for a Line Feed. FF = 14 Value for a Form Feed. CR = 15 Value for a Carriage Return. ESC = 33 Value for an 'Escape' character. SPACE = 40 Value for a 'Space' character. ERASE = 177 Value for an 'Erase' character. PARITY = 200 Parity bit for byte operations. SET = 1 Flag setting definitions. CLEAR = NULL ON = SET OFF = CLEAR MACRO LIBRARY PAGE 104 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** ADDCHR . . . X . . . . . ADDSTR . . . X . . . . . AND . . . . . X . . . ANDB . . . . . X . . . A. . . . . . . X . . BEGIN . . . . . X . . . BITDEF . X . . . . . . . BIT DEFINITIONS. BRJ . . . . . X . . . CALLG . . . . . X . . . CASE . . . . . X . . . CASEB . . . . . X . . . CLRSTR . . . X . . . . . CMPSTR . . . X . . . . . CONFIG . --- . --- . --- . --- . --- . --- . --- . This macro. (.MCALL "mac defs") C. . . . . . . X . . DEBUG . --- . --- . --- . --- . --- . --- . --- . Special macros for debugging. (NOTE 1) DELCHR . . . X . . . . . DETAB . . . . . . X . . DETEND . . . . . . X . . DEVIO . --- . --- . --- . --- . --- . --- . --- . DMPBIT . --- . --- . --- . --- . --- . --- . --- . Special macros for debugging. (NOTE 1) DMPOFF . --- . --- . --- . --- . --- . --- . --- . Special macros for debugging. (NOTE 1) DMPSYM . --- . --- . --- . --- . --- . --- . --- . Special macros for debugging. (NOTE 1) DO . . . . . X . . . DOWNTO . . . . . X . . . DUMP . --- . --- . --- . --- . --- . --- . --- . Special macros for debugging. (NOTE 1) ELSE . . . . . X . . . END . . . . . X . . . ENTRYP . . . . . X . . . EXIT . . . . . . X . . EXITER . X . . . . . . . EXITFA . . . . . . X . . EXITSU . X . . . . . . . EXITTR . . . . . . X . . FI . . . . . X . . . FILEFU . --- . --- . --- . --- . --- . --- . --- . Special IAS file macros. (NOTE 2) FLODEF . X . . . . . . . Floating point accumulator definitions. FNAMDE . --- . --- . --- . --- . --- . --- . --- . Special IAS file macros. (NOTE 2) FOR . . . . . X . . . MACRO LIBRARY PAGE 105 FOR.AB . . . . . X . . . MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** GENMAC . --- . --- . --- . --- . --- . --- . --- . Defines general macros. (NOTE 3) GOTO . . . . . X . . . IF . . . . . X . . . IFB . . . . . X . . . IFERRO . X . . . . . . . IFFALS . . . . . . X . . IFSUCC . X . . . . . . . IFTRUE . . . . . . X . . INITIA . X . . . . . . . INPUT . . X . . . . . . INPUTN . . X . . . . . . INSCHR . . . X . . . . . JUMPTO . . . . . X . . . LEAVE . . . . . X . . . LET . . . . . X . . . LIST . X . . . . . . . MACBAS . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MACDTB . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MACIO . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MACSTG . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MACSUP . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MACTBL . --- . --- . --- . --- . --- . --- . --- . Macro calls. (called by config) MESSAG . . . X . . . . . MFUNCT . . . X . . . . . MODCHR . . . X . . . . . MOVSTR . . . X . . . . . MACRO LIBRARY PAGE 106 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** MOVTEX . . . X . . . . . NCC . . . . . X . . . NCS . . . . . X . . . NEQ . . . . . X . . . NEWLIN . . X . . . . . . NGE . . . . . X . . . NGT . . . . . X . . . NHI . . . . . X . . . NHIS . . . . . X . . . NLE . . . . . X . . . NLO . . . . . X . . . NLOS . . . . . X . . . NLT . . . . . X . . . NMI . . . . . X . . . NNE . . . . . X . . . NODE . . . . X . . . . NODEBL . . . . X . . . . NOLIST . X . . . . . . . NOTRAC . . . . . X . . . NPL . . . . . X . . . NVC . . . . . X . . . NVS . . . . . X . . . ON.ERR . . . . . X . . . ON.NOE . . . . . X . . . OR . . . . . X . . . ORB . . . . . X . . . PAD . . . X . . . . . POP . . . . . X . . . POPB . . . . . X . . . POPCHR . . . X . . . . . PRESET . . . X . . . . . PRINT . . X . . . . . . PRINTA . . X . . . . . . PRINTB . . X . . . . . . PRINTC . . X . . . . . . PRINTD . . X . . . . . . PRINTH . . X . . . . . . PRINTO . . X . . . . . . PRINTR . . X . . . . . . PROBE . . . . . X . . . PROBEB . . . . . X . . . PROCED . . . . . X . . . PTEXT . . X . . . . . . PUSH . . . . . X . . . PUSHB . . . . . X . . . PUSHCH . . . X . . . . . P.D . . X . . . . . . QUEBUF . --- . --- . --- . --- . --- . --- . --- . Defined by SERIO and DEVIO. (NOTE 4) MACRO LIBRARY PAGE 107 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** RCC . . . . . X . . . RCS . . . . . X . . . REPCHA . . X . . . . . . REPEAT . . . . . X . . . REPORT . . . X . . . . . REQ . . . . . X . . . RESERV . . . X . . . . . RGE . . . . . X . . . RGT . . . . . X . . . RHI . . . . . X . . . RHIS . . . . . X . . . RLE . . . . . X . . . RLO . . . . . X . . . RLOS . . . . . X . . . RLT . . . . . X . . . RMI . . . . . X . . . RNE . . . . . X . . . ROLSTR . . . X . . . . . RORSTR . . . X . . . . . RPL . . . . . X . . . RVC . . . . . X . . . RVS . . . . . X . . . SAVE . X . . . . . . . SERIO . --- . --- . --- . --- . --- . --- . --- . .MCALL QUEBUF SETERR . X . . . . . . . SETFAL . . . . . . X . . SETREG . X . . . . . . . SETSUC . X . . . . . . . SETTRU . . . . . . X . . SHLSTR . . . X . . . . . SHRSTR . . . X . . . . . SMCALL . --- . --- . --- . --- . --- . --- . --- . Defines SUPMAC maros. (NOTE 3) SOJ . . . . . X . . . SPACES . . X . . . . . . SPPAD . . . X . . . . . STRING . . . X . . . . . SUBSTR . . . X . . . . . SUPMAC . --- . --- . --- . --- . --- . --- . --- . SUPMAC definitions. (NOTE 3) SWABST . . . X . . . . . MACRO LIBRARY PAGE 108 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** TABDEF . --- . --- . --- . --- . --- . --- . --- . Defines DTBMAC macros. (NOTE 3) TABLE . . . . X . . . . TABLEB . . . . X . . . . TABMAC . --- . --- . --- . --- . --- . --- . --- . DTBMAC definitions. (NOTE 3) TCLOSE . . . . X . . . . TCREAT . . . . X . . . . TERMIN . X . . . . . . . THEN . . . . . X . . . THRU . . . . . X . . . TINSER . . . . X . . . . TKILL . . . . X . . . . TLOOKU . . . . X . . . . TO . . . . . X . . . TPROTE . . . . X . . . . TRACE . . . . . X . . . TREAD . . . . X . . . . TREMOV . . . . X . . . . TSTSTR . . . X . . . . . TUNPRO . . . . X . . . . TWRITE . . . . X . . . . T..ALL . . . X . . . . . UNSAVE . X . . . . . . . UNTIL . . . . . X . . . UNTILB . . . . . X . . . WHILE . . . . . X . . . WHILEB . . . . . X . . . ZPAD . . . X . . . . . $CALL . . . . . X . . . $EOFFS . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $LAB . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $MOFFS . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $RETUR . . . . . X . . . $SET$K . . . . . X . . . $WOFFS . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $$END . . . . . X . . . $$EOFF . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $$LAB . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $$MOFF . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) $$WOFF . --- . --- . --- . --- . --- . --- . --- . Special auto label generation. (NOTE 5) MACRO LIBRARY PAGE 109 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** .ARITH . . . . . X . . . .CDFN . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CHAIN . . . . . . . X . .CHCOP . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CLOSE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CMKT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CNTXS . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CRAW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CRRG . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CSIGE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CSISP . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CSTAT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .CTIMI . . . . . . . X . .DATE . . . . . . . X . .DELET . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .DEVIC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .DRAST . . . . . . . X . .DRBEG . . . . . . . X . .DRBOT . . . . . . . X . .DRDEF . . . . . . . X . .MCALL .DRAST,.DRBEG,.DRBOT,.DREND, .DRFIN,.DRSET,.DRVTB,.FORK, .QELDF,.TIMIO,.CTIMI .DREND . . . . . . . X . .DRFIN . . . . . . . X . .DRSET . . . . . . . X . .DRVTB . . . . . . . X . .DSTAT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .ELAW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .ELRG . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .EMIT . X . . . . . . . .EMITL . X . . . . . . . .EMITR . X . . . . . . . .ENTER . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .EXIT . . . . . . . X . MACRO LIBRARY PAGE 110 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** .FETCH . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .FORK . . . . . . . X . .GENBR . . . . . X . . . .GMCX . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .GOTO . . . . . X . . . .GTIM . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .GTJB . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .GTLIN . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .GVAL . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .HERR . . . . . . . X . .HRESE . . . . . . . X . .IFOPR . . . . . X . . . .INTEN . . . . . . . X . .IS . . . . . X . . . .LEAVE . . . . . X . . . .LOCK . . . . . . . X . .LOOKU . . . . . . . X . .MACS . . . . . . . X . .MCALL ...CM0, TO ,...CM6 .MAP . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MFPS . . . . . . . X . .MRKT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTATC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTDTC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTGET . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTIN . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTOUT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTPRN . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTPS . . . . . . . X . .MTRCT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTSET . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MTSTA . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .MWAIT . . . . . . . X . .OPADD . . . . . X . . . .OPSUB . . . . . X . . . .OR . . . . . X . . . MACRO LIBRARY PAGE 111 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** .PRINT . . . . . . . X . .PROTE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .PURGE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .QELDF . . . . . . . X . .QSET . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RCTRL . . . . . . . X . .RCVD . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RCVDC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RCVDW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RDBBK . . . . . . . X . .RDBDF . . . . . . . X . .READ . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .READC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .READW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .REGDE . . . . . . . X . .RELEA . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RENAM . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .REOPE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .RSUM . . . . . . . X . .SAVES . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SCCA . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SDAT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SDATC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SDATW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SDTTM . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SERR . . . . . . . X . .SETTO . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SFPA . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SIMPL . . . . . X . . . .SPCPS . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .SPFUN . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) MACRO LIBRARY PAGE 112 MACRO LIBRARY BASMAC IOMACS STGMAC TBLMAC SUPMAC DTBMAC RT11 ************* ****** ****** ****** ****** ****** ****** **** .SPND . . . . . . . X . .SRESE . . . . . . . X . .SYNCH . . . . . . . X . .TIMIO . . . . . . . X . .TLOCK . . . . . . . X . .TRPSE . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .TTINR . . . . . . . X . .TTOUT . . . . . . . X . .TTYIN . . . . . . . X . .TTYOU . . . . . . . X . .TWAIT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .UNLOC . . . . . . . X . .UNMAP . . . . . . . X . .UNPRO . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .WAIT . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .WDBBK . . . . . . . X . .WDBDF . . . . . . . X . .WRITC . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) .WRITE . . . . . . . X . .WRITW . . . . . . . X . .MCALL ,MACS (...CM0, TO ,...CM6) ..ACT . . . . . . X . . ..ARLE . . . . . . X . . ..BRAN . . . . . X . . . ..COND . . . . . . X . . ..CRLE . . . . . . X . . ..ERLE . . . . . . X . . ..GET . . . . . X . . . ..LB10 . . . X . . . . . ..LB21 . . . X . . . . . ..LB22 . . . X . . . . . ..LB23 . . . X . . . . . ..POP . . . . . X . . . ..PUSH . . . . . X . . . ..TAG . . . . . X . . . ..TEST . . . . . . X . . ..TPRM . X . . . . . . . ..V1.. . . . . . . . X . ..V2.. . . . . . . . X . ...CM0 . . . . . . . X . ...CM1 . . . . . . . X . ...CM2 . . . . . . . X . ...CM3 . . . . . . . X . ...CM4 . . . . . . . X . ...CM5 . . . . . . . X . ...CM6 . . . . . . . X . MACRO LIBRARY PAGE 113 NOTES:- ===== 1. These are special MACROS for debugging purposes, and must be defined independently when used. 2. These are special IAS file handling macros which must be defined independently. 3. These macros are 'macro defining macros' and are uneccessary when using CONFIG. They are retained for previous compatability. 4. These are defined by other macros when required. 5. These are auto label generation macros which are only for use by experienced programmers. If in any doubt then DON'T USE, you have been warned. They are defined by existing macros when required. CHAPTER 13 SUPER-MAC REFERENCE GUIDE - VERSION 47. INDEX 1 SUPER-MAC HEADER. PAGE 115 2 SUPER-MAC DISCLAIMER. PAGE 116 3 SUPER-MAC INTRODUCTION. PAGE 117 4 ASSIGNMENT STATEMENT. PAGE 118 5 UNARY OPERATORS. PAGE 121 6 CONDITIONAL EXECUTION STATEMENTS. PAGE 122 7 LOOP CONTROL STATEMENTS. PAGE 128 8 MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 132 9 SUPER-MAC ERROR MESSAGES. PAGE 141 SUPER-MAC HEADER. PAGE 115 LDM 106 DOC #130-380-007-00 SUPER-MAC ========= REFERENCE GUIDE =============== VERSION 47 ========== SUPER-MAC DISCLAIMER. PAGE 116 COPYRIGHT (C) 1975 (SUPER-MAC) DIGITAL EQUIPMENT CORPORATION The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this manual. The software described in this document is furnished to the purchaser under a license for use on a single computer system and can be copied (with inclusion of DIGITAL's copyright notice) only for use in such system, except as may otherwise be provided in writing by DIGITAL. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL. NOTE:- Since the appearance of SUPER-MAC in the public domain, numerous enha- ncements have been made which improve both the applicability and port- ability of SUPER-MAC source code. During this enhancement process every effort has been made to maintain compatability for source code generated under earlier version of SUPER-MAC. Arthur P. Gaughan, JR. 5-dec-78 This manual documents Super-Mac version 47. In addition the following changes have been made. 'SOB' to 'SOJ' (to avoid MACRO-11 conflict) TRACE FACILITY in 'PROCEDURE' and 'ENTRYPOINT'. 'SAVE' macro call in 'PROCEDURE'. Listing error correction. 'LIST' and 'NOLIST' implementation. J.S.Clifton. 31-Dec-81 SUPER-MAC INTRODUCTION. PAGE 117 Introduction ============ SUPER-MAC is a set of structured programming macros that allows programs to be written in a high level, easily understood language. It is assumed that the user is familiar with macros in general and with MACRO-11 in particular. The language statements and clauses within this guide are divided into three categories: Assignment statement, Conditional statements and Miscellaneous statement. The Conditional category of statements is further divided into Conditional Execution type statements and Loop Control statements. There are three branch type statements: LEAVE, GOTO and JUMPTO. The LEAVE and GOTO statements are cased special branches used with the IF statement. They are, therefore, included in the conditional category. The JUMPTO statement is included in the Miscellaneous category. As a general rule, most SUPER-MAC statements can be single-line statements or multiple-line (nested) block statements. A single-line statement must be completed on one source line; no continuation lines are allowed. Single-line statements should be as short and simple as possible. Comments may also be included on a source line. All the general rules, conditions, etc., that govern MACRO-11 also govern SUPER-MAC. Spacing on a source lne is very important. The elements should be separated by a comma or a space. Tabs should never be used for spacing. For example: The expression A+B is interpreted different than A + B. All the conditional statements can be written as multiple-line nested blocks. Each level of nesting within a block must be terminated with an associated END statement. Each level of nesting should be indented two spaces. User written macros or assembly language instructions may be included in a program if desired. All programs must begin with the macro call supmac. This call initializes SUPER-MAC and TABMAC.MAC. This guide contains examples of all statements. In nested block examples, the END statements associated with a particular statement are noted. When an example includes assembly language instructions, that instance is pointed out. A list of possible error codes is included as well as an assembled listing of some typical examples. All legal PDP-11 source and destination operands are legal in SUPER-MAC. ASSIGNMENT STATEMENT. PAGE 118 Assignment Statement ==================== LET is the only assignment statement contained in SUPER-MAC. LET STATEMENT ============= The LET statement is an arithmetic assignment or replacement statement. The form of the statement is: LET [Destination] expression [Operand ] expression is in the form: (unary operator) operand (binary operator operand binary operator...) Where: ( ) means optional NOTE ==== Care must be taken in the construction of a LET statement. Some constructions (where the destination operand type modifies the register used on the formation of the destination address) appear to be what the programmer desired, but the assembler will generate code that is different from the intent. Example:- ========= The statement LET (R5)+ := R1 + R2 will generate the code MOV R1,(R5)+ ADD R2,(R5)+ not the desired MOV R1,(R5) ADD R2,(R5)+ In order to get the desired result, the following construction is necessary: LET (R5) := R1 ;MOV R1,(R5) LET (R5)+ := (R5)+ + R2 ;ADD R2,(R5)+ ASSIGNMENT STATEMENT. PAGE 119 SUPER-MAC recognizes all the special characters accepted by MACRO-11 as well as some additional assignment/replacement characters. The additional assignment or replacement characters are listed below: := OR :W= ;These are assignment or replacement ;characters that imply WORD movement. Example:- ========= LET R0 := .PSTPT Moves the WORD represented by .PSTPT into R0. :B= OR :== ;These are assignment or replacement ;characters that imply BYTE movement. Example:- ========= LET R0 :B= @.PSTPT In this case, the BYTE that is pointed to by PSTPT is moved to R0. SUPER-MAC has some special operators that are used for bit set and bit clear operations. The operators are listed below: BIT CLEAR OPERATORS INSTRUCTION GENERATED =================== ===================== NAND BIC OFF.BY BIC Either can be used since they produce the same code. BIT SET OPERATORS INSTRUCTION GENERATED SET.BY BIS OR BIS Either one can be used since they produce the same code. Examples:- ========== LET T.FLAG(R2) := T.FLAG(R2) SET.BY #TP.ENB LET T.FLAG(R2) := T.FLAG(R2) OFF.BY #TP.ENB LET $SYSCL := $SYSCL OFF.BY #CL.NER LET (R2) := (R2) NAND R1 ASSIGNMENT STATEMENT. PAGE 120 SUPER-MAC accepts all the symbols recognized by MACRO-11. The special symbols utilized by SUPER-MAC are listed below: SYMBOL DESCRIPTION ====== =========== CARRY C BIT (carry bit) PUSH Keyword destination for pushing on to stack POP Keyword for popping off of stack. TOP Keyword for top of stack. The legal binary operators for use in SUPER-MAC are described in Table 1-1. Table 1-1 shows the relationships that can be established between expression terms through the use of binary operators and also shows the machine instruction generated when the macro is assembled. Table 1-1 ********* Legal Binary Operators ********************** BINARY EXPLANATION EXAMPLE MACHINE ====== =========== ======= ======= OPERATION INSTRUCTION ========= =========== + Addition A + B ADD - Subtraction A - B SUB * Multiplication R0 * #2 MUL / Division R0 / #2 DIV L.SHIFT Arithmetic Left Shift R0 L.SHIFT1* ASL R.SHIFT Arithmetic Right Shift R0 R.SHIFT 1* ASR L.ROTATE Left Rotate R0 L.ROTATE 1* ROL R.ROTATE Right Rotate R0 R.ROTATE 1* ROR SHIFT Shift Arithmetically R0 SHIFT #2 ASH C.SHIFT Arithmetic Shift Combined R0 C.SHIFT #3 ASHC XOR Exclusive OR A XOR R5 XOR NAND Not AND (R2) NAND R1 BIC OFF.BY (R2) OFF.BY R1 BIC SET.BY Inclusive OR (R2) SET.BY R1 BIS OR (R2) OR R1 BIS * = Number designates the number of times the instruction is repeated; i.e., the number of shifts. UNARY OPERATORS. PAGE 121 The legal unary operators are:- =============================== - Negation NEG NOT Complement COM If the assignment operator in a LET statement is not a legal SUPER-MAC operator, an error message will be generated. Examples:- ========== LET (R2) := (R2) - #1 ;This generates DEC (R2) LET (R2) := (R2) - #01 ;This generates SUB #01,(R2) LET (R2) := (R2) OR R1 LET R2 := #0 ;This generates CLR R2 LET R2 := R1 LET T.VAL(R2) := $VAL2 LET R0 := R0 L.SHIFT 3 LET R1 := R1 + #1 ;This generates an INC R1 LET R1 := R1 + #01 ;This generates an ADD #01,R1 LET R0 := R0 + CARRY ;This generates on ADC R0 CONDITIONAL EXECUTION STATEMENTS. PAGE 122 Conditional Statements ********************** This category of SUPER-MAC statements is subdivided into Condition Execution statements and Loop Control statements. Condition Execution Statements ****************************** IF STATEMENT ============ IFB STATEMENT ============= An IF statement causes a conditional transfer or statement execution. The IFB statement forces a byte operation. IF statements can be either a single-line statement or a multiple-line (block) statement. The single-line statement takes the form: IF [GOTO ] SUPER-MAC statement [LEAVE] [THEN ] The test portion of the IF statement takes the form: [CC] [CS] [EQ] [GE] [GT] [HI] Source [HIS] Destination Operand [LE] Operand [LO] [LOS] [LT] [MI] [NE] [PL] [VC] [VS] (Note: these are the MACRO-11 branch instructions without the "B". GE not BGE.) A single line statement may have as many arguments as desired, provided that all arguments can be completed on the single line. IF $NVAL HI #2 GOTO REJ1 CONDITIONAL EXECUTION STATEMENTS. PAGE 123 IF AND STATEMENT ================ IF ANDB STATEMENT ================= The AND statement is a logical conjunction. The expression is true if, and only if, both A and B are true. The ANDB statement forces a byte operation. AND can only be used with the IF. The form is: A AND B Example:- ========= IF (R2) EQ (R1) AND 2(R2) EQ 2(R1) THEN RETURN/$RETURN NOERROR IF OR STATEMENT =============== IF ORB STATEMENT ================ The OR statement is a logical disjunction. The expression is true if, and only if, either A or B, or both is true. The ORB statement forces a byte operation. The OR can only be used with an IF statement. The form of the OR is: A OR B Example:- ========= IF A EQ #0 OR A NE C THEN LET A := D The block IF statement requires an END and takes the form: IF........... coding . . . . . coding END Example:- ========= IF A EQ #0 LET $VAL2 := T.VAL(R2) END CONDITIONAL EXECUTION STATEMENTS. PAGE 124 ELSE CLAUSE =========== The ELSE clause is only used with an IF block. Used in any other statement, an error message will be generated. ELSE must stand on its own line with no arguments. Example:- ========= IF RESULT IS EQ LET $VAL2 := T.VAL(R2) ELSE LET $VAL1 := R2 + #T.VAL END Multiple IF statements can be nested. Each multiple-line IF statement within the nest requires an END. Example:- ========= IF .PNUMH EQ #0 LET $NVAL := $NVAL + #1 IF $NVAL LOS #2 IF RESULT IS EQ LET $VAL2 := .PNUMB ELSE LET $VAL1 := .PNUMB END END END Special cases of the IF statement perform bit tests. One case tests to determine if the bits are set and the other tests to determine if the bits are CLEAR. Examples:- ========== IF A SET.IN B THEN... IF A OFF.IN B THEN... CONDITIONAL EXECUTION STATEMENTS. PAGE 125 Another special case IF statement is a test for zero. Example:- ========= IF A GT #0 THEN... A third special case is a test of current condition code setting. This is indicated by RESULT IS. NOTE:- that SUCCESS and ERROR can follow an IS which tests the state of the C bit. IF RESULT IS SUCCESS THEN ....... IF RESULT IS ERROR THEN ...... Example:- ========= IF RESULT IS EQ THEN... ON.ERROR STATEMENT ================== ON.NOERROR STATEMENT ==================== Both of these statements are special case IF statements that check the condition of the C bit. The ON.ERROR statement tests to determine if the C bit is set and the ON.NOERROR statements tests to determine if the C bit is cleared. Both statements require an END statement if a multiple line procedure is required to rectify the problem indicated by the condition of the C bit. Both statements result in an IF RESULT IS type statement. CONDITIONAL EXECUTION STATEMENTS. PAGE 126 Examples:- ========== ON.ERROR IF #CL.NER OFF.IN $SYSCL CALL/$CALL $MGOUT END $POSYM CLC ;Macro instruction ELSE $POSYM CLC END ON.ERROR LEAVE SETBLK ON.ERROR $PUSH #STSPT CALL/$CALL $FCSYM INC (SP)+ ;Macro instruction ON.ERROR LET 16(SP) := 16(SP) + #2 END END ON.ERROR LET PUSH := T.VAL(R2) CALL/$CALL $RPREG CALL/$CALL @(SP)+ CALL/$CALL $SPREG END ON.NOERROR THEN LET T.FLAG(R2) := T.FLAG(R2) LEAVE STATEMENT =============== GOTO STATEMENT ============== These statements are similar in that they transfer program control from one point to another point. Their use and purpose are different. The LEAVE statement is used when it is necessary to transfer out of a program block or loop due to some condition within the block or loop that can be tested. The test is usually made with an IF expression. CONDITIONAL EXECUTION STATEMENTS. PAGE 127 Example:- ========= BEGIN ALPHA . . IF RESULT IS NE LEAVE ALPHA . . END ALPHA In this example, the result of a previous action is tested. If the result does not equal zero, program control is transferred to the expression that follows the END. WHILE A NE B . . coding IF C EQ #0 LEAVE LOOP . . coding END In this example, if C is equal to zero, the LEAVE will generate a branch outside of the WHILE loop. The GOTO statement also creates a branch instruction. The pointer of the branch instruction is the value of the symbolic name given by the programmer. The form is: GOTO name Examples:- ========== GOTO SETCM IF A EQ B GOTO SETCM Program control transfers to a routine labelled SETCM. THEN CLAUSE =========== The THEN clause is used in conjunction with other statements. The first statement performs a designated action and THEN performs a second action. The THEN clause takes the following form: THEN arguments Example:- ========= IF (R2) EQ (R1) AND (R2) EQ 2(R1) THEN RETURN/$RETURN NOERROR LOOP CONTROL STATEMENTS. PAGE 128 Loop Control Statements *********************** FOR STATEMENT ============= The FOR statement is a means of controlling loop execution used to change the value of an operand by a designated amount until a set limit is reached. The FOR statement is used with the TO, DOWNTO and BY statements. The form of the FOR statement is: FOR operand [TO ] limit [BY increment (optional)] [DOWNTO] END The default condition of the increment is one. The FOR statement must contain an END statement unless the statement is a single-line entry followed by a THEN statement. The THEN statement must be followed by arguments: Example 1:- =========== FOR A := B TO C BY D . . coding END . This example causes B to be moved to A, D is added to A and A compared with C. If the comparison fails, the loop process continues until the comparison passes. The FOR statement is a WORD operation statement only. Example 2:- =========== FOR A := B DOWNTO C BY D . . coding END This examples causes B to be moved to A, D is subtracted from A and A is compared with C. If the comparison fails, the process continues until the comparison passes. Example 3:- =========== FOR R0 := R1 TO R2 THEN LET R4 := R4 / #2 This example causes the contents of R1 to be moved to R0. The contents of R4 are divided by two and R0 is incremented. R0 and R2 are compared. If the comparison fails, the process continues until the comparison passes. LOOP CONTROL STATEMENTS. PAGE 129 Example 4:- =========== FOR R0 := R1 DOWNTO R2 LET R4 := R4 * #2 END This causes the contents of R1 to be moved to R0. R4 is multiplied by two and R0 is decremented. The contents of R0 and R2 are compared. If the comparison fails, the process continues until the comparison passes. REPEAT STATEMENT ================ UNTIL STATEMENT =============== UNTILB STATEMENT ================ The REPEAT statement causes a procedure to be repeated until a specified condition is met. The REPEAT statement executes the procedures, tests the specified condition and stops the repeat loop when the desired condition is met. REPEAT statements can be single-line statement or multiple line statements. The single-line REPEAT takes the form: REPEAT UNTIL condition Example:- ========= REPEAT UNTIL (R0)+ EQ (R1)+ This example can best be illustrated by examination of the assembly code generated. The assembler generated the following code: B1;;;;;;; CMP (R0)+,(R1)+ BNE B1 E1;;;;;;; As can be seen the comparison is repeated until it passes, then the action stops. There are two types of multiple-line REPEAT statements. The first type repeats a procedure until a specified condition is met. The second type is an infinite repeat (repeat loop) and is termiated by an END statement. LOOP CONTROL STATEMENTS. PAGE 130 Examples:- ========== REPEAT CALL/$CALL C, UNTIL R4 NE, R0 The next examples contains a LEAVE statement and was coded within a BEGIN block. BEGIN ALPHA . . . REPEAT CALL/$CALL F IF RESULT IS NE LEAVE ALPHA . . END . . END ALPHA The UNTIL statement can only be used within a REPEAT statement. The UNTIL statement defines the condition(s) that stop the REPEAT from looping. The UNTILB forces a byte operation. An error message will be generated if UNTIL is used in a statement other than a REPEAT. THRU STATEMENT ============== The THRU statement is used to control loops. The statement must contain an END statement. The THRU statement generates an SOB (subtract one and branch) instruction. The statement takes the form: THRU arguments END The first argument must be a register or an expression (LET) with a register as the destination. If the first argument is not a register, an error message will be generated. The register contains a number that represents the number of times the action must loop. LOOP CONTROL STATEMENTS. PAGE 131 Example 1:- =========== IF R2 HI # 6 THEN LET R2 := #6 THRU R2 MOVB (R0)+,(R1)+ ;Note macro instruction END In this example, R2 contains an integer between 1 and 6. Each time the MOVB instruction is executed, the SOB subtracts one from the contents of R2. When R2 becomes zero, the loop is left. WHILE STATEMENT =============== WHILEB STATEMENT ================ The WHILE statement establishes a condition that permits (controls) action from other statements. As long as the condition exists, the action(s) will be permitted. The form of the statement is: WHILE condition coding . . . coding END The WHILEB statement forces a byte operation. Example:- ========= LET R5 := (R4)+ ;Get start addr of table WHILE R5 LO (R4) CALL/$CALL DTBL ;Go display entry LET R5 := R5 + #S.SYCT ;Get next entry END $$END STATEMENT =============== The $$END statement supplies an END if those statements are missing within nested blocks. The $$END prints a message on the assembly listing for the missing END(S). The user should check the source code to determine if the assembled code will execute as intended. $$END is intended for the detection of user "error" (i.e., missing END) conditions. MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 132 Miscellaneous Statements ************************ BEGIN/END STATEMENT =================== The BEGIN/END statement provides a mechanism for escaping from a routine in case some problem develops. The block of code associated with the BEGIN statement is terminated with the END statement. The statement takes the form: BEGIN name ;Begins a contiguous block ;of code known as 'name' IF RESULT ... LEAVE name ;A conditional method of ;escape ;from 'name'. The Branch ;pointer points to END name. ON.ERROR LEAVE name ;Another method of escape END name ;End of block. Following are two examples of the BEGIN/END statement: Example 1:- =========== BEGIN SETBLK $PHSYM ;PUSH symbols (macro call) CALL/$CALL $SCHLT ;Search table. ON.ERROR LET... CALL/$CALL ... ON.ERROR LEAVE SETBLK ;Escape if C bit set. IF... LET... ELSE LET... END LET... LET... LET... END ;END of ON.ERROR LET $POSYM ;POP of symbols (macro call) RETURN/$RETURN END SETBLK ;END of SETBLK MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 133 Example 2:- =========== BEGIN ALPHA IF...GT...B THEN CALL/$CALL ... ;One line IF statement REPEAT UNTIL... ;One line REPEAT REPEAT ;Multiple line REPEAT CALL/$CALL ... UNTIL...EQ... ;Terminate condition CALL/$CALL REPEAT ;REPEAT loop CALL/$CALL ... IF RESULT...LEAVE ALPHA ;One line IF and a LEAVE WHILE...IS...THEN... END ;End of the REPEAT loop END ALPHA ;End of the Alpha block MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 134 CALL/$CALL STATEMENT (USE CALL FOR -11D/IAS AND $CALL FOR -11M) ===================== The ($) CALL statement is used to transfer control (via a JSR PC) from one program unit to another. It may also be used to pass parameters in the registers (R0-R5) between those program units. Upon completion of the call, execution is returned to the statement following the CALL/$CALL . The form of the CALL/$CALL statement is: CALL/$CALL NAME, NAME is the symbolic name of the program unit being called and ARGS are parameters. ARGS is optional and if used must be in brackets. If ARGS is used without brackets, an error message will be generated. The ARGS may have six parameters. The position of the parameters within the ARGS brackets indicate the register that will contain that particular parameter. Register designations are from left to right, with R0 as the first. If more than 6 parameters are included, a warning message will be generated. Examples:- ========== CALL/$CALL $SCHLT <#$DYNTB,R1> CALL/$CALL $FLSYM CALL/$CALL DTBL CALL/$CALL F In the last example, FOO is moved to R0, BAR is moved to R1 and a JSR PC is generated to F. In the next example, #X is moved to R0, #Y is moved to R1, Z is moved to R2 and the JSR PC is to E. CALL/$CALL E <#X,#Y,Z> When macros are nested, ARGS must have multiple brackets, for example: IF A EQ B THEN CALL/$CALL C <<>> The example shown uses one bracket pair for each statement, one pair for the IF, one for the THEN and one for the CALL/$CALL. MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 135 CALLG STATEMENT =============== The CALLG statement (call with general arguments) is used to transfer control from one program unit to another and to pass parameters to program unit via a FORTRAN COMPATIBLE PARAMETER BLOCK. The parameter block is built at runtime and follows the FORTRAN convention for null arguments (C.F. The FORTRAN IV and the FORTRAN IV+ USER'S GUIDE) and arguments count. General purpose register R5 is first saved, used to point to the head of the parameter block on the call out of line, and then restored on return. No other registers are used/preserved - it is the user's responsibility to save/restore registers as necessary. The CALLG statement may be used to call either FORTRAN LIBRARY SUBROUTINES which expect an R5 call or any MACRO-11 subroutine which is FORTRAN CALLABLE. N.B!!!!! In either of these cases care must be used in formatting the parameter list in the CALLG statement to ensure that "CALL BY NAME" is employed rather than "CALL BY VALUE". In most cases this will mean using immediate mode addressing (mode 2 - register 7). However, the require- ment simply stated is as follows:- The parameter list must be a list of "ADDRESSES" of arguments rather than the arguments themselves! The CALLG statement may also be used to call NON-FORTRAN compatible MACRO-11 subroutines in which case the resolution of the "CALL BY NAME" - "CALL BY VALUE" conflict is at the discretion of the program- mer. In all calls the nesting rules described for $CALL apply. Examples:- ========== CALLG SPLAT ;No arguments - use only for FORTRAN ;type compatability, else use $CALL/ ;CALL. CALLG SPLAT <#ARG1,,#ARG3> CALLG SPLAT <#ARG1,,R0,,STIPL> MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 136 RETURN/$RETURN (USE RETURN FOR -11D/IAS AND $RETURN FOR -11M) ============== The RETURN statement is used to return control from a subprogram unit to the calling program unit. The statement allows a return with status, with a register or both. The statement takes the form: RETURN/$RETURN STA,REG Examples: - Machine Instructions ========== RETURN/$RETURN WITH R5 RTS R5 RETURN/$RETURN ERROR R2 SEC RTS R2 RETURN/$RETURN NOERROR R5 CLC RTS R5 RETURN/$RETURN ERROR SEC RTS PC RETURN/$RETURN NOERROR CLC RTS PC RETURN/$RETURN STAT R5 MOVB STAT,-(SP) ROLB (SP)+ RTS R5 RETURN/$RETURN R4 MOVB R4,-(SP) ROLB (SP)+ RTS PC RETURN/$RETURN ,R5 RTS R5 MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 137 POP Statement ============= The POP statement is used for popping word data off the stack. The statement takes the form: $POP P1,P2,P3,...P10 The argument(s) (P1,P2...) can be any legal destination WORD operand of they may be TOP in which case the TOP (WORD) element on the stack is POPPED into never-never land. Example: - Generated Code ========= POP R0,R4 MOV (SP)+,R0 MOV (SP)+,R4 POP R0,TOP MOV (SP)+,R0 MOV (SP),(SP)+ The user will note that since MOV instructions are used throughout, the CARRY BIT is preserved across all POPS. POPB Statement ============== The POPB statement provides a similar facility fo BYTE dat as that provided by POP. The arguments (P1,P2...) can be any legal destination BYTE operand. However, they may NOT be TOP. The POPBed byte is always the low-order byte on the top of the stack. Remember, each BYTE POPBed from the stack actually pops one WORD from the top of the stack. MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 138 PUSH Statement ============== The PUSH statement provides a method for pushing WORD data on to the stack. The statement takes the form: PUSH P1,P2,P3...P10 Example:- Generated Code ========= PUSH R4,R0 MOV R4,-(SP) MOV R0,-(SP) PUSHB Statement =============== The PUSHB statement provides a method for pushing BYTE data on the stack. The argument(s) (p1,p2...) can be any legal source BYTE operand. The PUSHed operand always occupies the low-order byte on the top of the stack with the high-order byte on the top of the stack CLEAR. Remember, each byte PUSHed actually reserves one WORD on the stack. MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 139 JUMPTO Statement ================ The JUMPTO statement creates a jump (JMP) instruction with the pointer pointing to a symbolic name given by the programmer. The form is: JUMPTO name CASE(B) Statement ================= CASE(B) are statement(s) that will issue a call to a subroutine that can be selected by a variable. CASE(B) must be terminated by an END statement. The form of the CASE(B) statement is: CASE(B) variable Routine 0 Routine 1 Routine 2 Routine 3 . . Routine n END where: variable is 0,1,2,3...n The selector variable can be any legal BYTE (CASEB) or WORD (CASE) operand that contains the desired number or it can be TOP. TOP signifiies either the low-order BYTE (CASEB) or WORD (CASE) on top of the stack. If TOP is used, the TOP WORD/BYTE entry on the stack is altered. Example:- ========= LET R0 := #2 CASE R0 or CASE #2 ADDVAL SUBVAL ORVAL END Upon completion of the CASE(B) (END), control will be transferred to the ORVAL subroutine. When the ORVAL has finished, i.e., has executed a RETURN, execution will be resume at the statement following the END. The programmer must be careful to validate the range of the variable for use with the CASE(B) statement. (Note: CASE(B) does not generate PIC position independent code). MISCELLANEOUS SUPER-MAC STATEMENTS. PAGE 140 PROCEDURE Statement. ==================== PROCEDURE is a statement which allows the programmer to implicitly establish an entry point for a subroutine (procedure). The form of the PROCEDURE statement is:- PROCEDURE NAME,TYPE,SAVE Where NAME is any legal MACRO-11 label. TYPE may be assigned either the keyword LOCAL or GLOBAL. If TYPE is unspecified the default is LOCAL. If type is unrecognised the default is GLOBAL. SAVE may be used as a savereg by calling the appropriate macro. ENTRYPOINT Statement ==================== ENTRYPOINT is a statement which allows the programmer to implicitly establish an alternate entry point label for a procedure. The form of the ENTRYPOINT statement is:- ENTRYPOINT NAME,TYPE Where NAME is any legal MACRO-11 label. Type may be assigned either the keyword LOCAL of GLOBAL. If TYPE is unspecified the default is LOCAL. If TYPE is unrecognised the default is GLOBAL. PROBE and PROBEB Statement ========================== PROBE and PROBEB enable the programmer to generate an inline TST or TSTB instruction and thus set up the condition codes for a subsequent IF RESULT IS ... conditional test. SUPER-MAC ERROR MESSAGES. PAGE 141 ERROR MESSAGES ============== Listed below are the error messages generated by SUPER-MAC. STACK UNDERFLOW!!! IF SYNTAX ERROR --- IS ELSE SEEN IN OTHER THAN IF BLOCK UNTIL SEEN IN OTHER THAN REPEAT BLOCK --- MUST BE A REGISTER --- STRANGE SUPER-MAC STACK VALUE --- ...ARGS MUST BE WITHIN <> --- NOT A LEGAL ASSIGNMENT OPERATOR 6 ARG MAX (R0-R5) --- NOT A LEGAL OPERATOR CHAPTER 14 DECISION TABLES - REFERENCE GUIDE. INDEX 1 DECISION TABLES IN MACRO - 11. PAGE 144 2 DECISION TABLE ELEMENTS. PAGE 145 3 TYPES OF DECISION TABLE. PAGE 146 4 DASH RULE/NESTING OF. PAGE 147 5 DECISION TABLE CONVERSION INTO OPERATIONAL COMPUTER PROGRAMS. PAGE 148 6 ADVANTAGES CLAIMED FOR USE OF DECISION TABLES. PAGE 149 7 DECISION TABLE IMPLEMENTATION IN MACRO - 11. PAGE 150 8 INTERPRETATION OF MACRO-11 DECISION TABLES. PAGE 151 9 INCOMPLETE DECISION TABLES. PAGE 153 10 MACRO DECISION TABLE FORMATS. PAGE 154 11 ......CONDITIONS. PAGE 155 12 ......ACTIONS/DETEND. PAGE 156 13 ......EXTENDED ENTRIES. PAGE 157 14 DECISION TABLE EXAMPLE. PAGE 158 15 DEBUGGING & TRACING FACILITIES. PAGE 159 DECISION TABLES - REFERENCE GUIDE. PAGE 143 COPYRIGHT (C) 1981 (TABLE-MAC) CIVIL AVIATION AUTHORITY The information in this document is subject to change without notice and should not be contrued as a commitment by the CIVIL AVIATION AUTHORITY who assume no responsibility for any error which may appear in this manual. AUTHOR:- J.S.Clifton Civil Aviation Authority. Air Traffic Evaluation Unit. Hurn Airport, Christchurch. Dorset. England. DECISION TABLES IN MACRO - 11. PAGE 144 DECISION TABLES IN MACRO - 11, THEORY ===================================== Decision tables may be considered to be an affective substitute for, or an auxiliary aid to the flow diagram as well as a program in their own right. The decision table provides information concerning problems and solutions in a concise tabular format that is easy to read and understand. This tabular approach is particularly useful in sit- uations involving complex logic. The basic structure of the table forces the person concerned to formulate a clear statement of conditions and actions and to con- sider ALL POSSIBLE LOGICAL combinations of the conditions. DECISION TABLE ELEMENTS. PAGE 145 BASIC ELEMENTS ============== CONDITION STUB CONDITON ENTRY. ============== =============== List of relevant All combinations of conditions conditions that must be considered seperately ACTION STUB ACTION ENTRY =========== ============ Actions to be taken Actions to be taken for each in all circumstances particular set of conditions. Example:- ========= We wish to play golf on Saturday. It will depend on two things - whether or not the grass needs cutting and the weather. VIZ, - if the weather is fine and the grass needs cutting, cut the grass in the morning and play golf in the afternoon. If the weather is fine but the grass does not need cutting, play golf in the moring. If its raining do neither. R1 R2 R3 R4 C1 Is the weather fine. Y Y N N C2 Does the grass need cutting. Y N Y N A1 Cut the grass Sat. a.m. X A2 Play golf Sat. a.m. X A3 Play golf Sat. p.m. X TYPES OF DECISION TABLE. PAGE 146 TYPES OF DECISION TABLE. ======================== There are 3 types of Decision table. LIMITED ENTRY. ============== The previous table falls, into this category. The condition stub specifies completely the question and the condition entries are YES(Y), NO(N) or Not Applicable (-). Logically, question order doesn't matter but practically it could be important when it comes to condensing. EXTENDED ENTRY. =============== Suitable for initial problem definition as it gives greater flexi- bility in expressing each condition and action. In this form only part of the condition is contained in the stub, the rest appearing in the entry area. Example:- ========= STUB ENTRY ---- ----- age under 21 over 21 over 25 over 25 DASH RULE/NESTING OF. PAGE 147 MIXED ENTRY. ============ A combination of (a) and (b). The most flexible form for manual or program use. It can be used to represent the single and complex case with equal ease. THE DASH RULE. ============== Enables the tables to be considerably condensed in certain circumstances. In certain situations, when one of the major conditions is satisfied, the motion specified is independent of the minor conditions. In this case the minor condition entries are replaced by dashes. (see Problem 2). NESTING TABLES. =============== If there are so many conditions that the decision table becomes too large to handle, the problem may be easily segmented. This can be achieved by defining some of the actions so that control is trans- ferred to another table. Example:- ========= GOTO Table 2. OPEN AND CLOSED TABLES. ======================= A table is said to be 'open' if the last action is GOTO another table name. In a closed table the final action does not specify entry to another table. If the closed table is to represent a subroutine of a program then control will return to the master table. DECISION TABLE CONVERSION INTO OPERATIONAL COMPUTER PROGRAMS. PAGE 148 CONVERSION INTO OPERATIONAL COMPUTER PROGRAMS. ============================================== FOUR MAIN WAYS:- ---------------- 1. By a programmer, using accepted conversion techniques. 2. By a Pre-processor, a software program that works on Tables where Condition and Action statements have been ex- pressed in, say, COBOL or FORTRAN and produce a program in that language. 3. By a Direct Compiler, producing machine Code programs. 4. By an Interpretive Processor, an object program loaded into the computer, which both interprets and processes data at runtime. ADVANTAGES CLAIMED FOR USE OF DECISION TABLES. PAGE 149 ADVANTAGES CLAIMED FOR USE OF DECISION TABLES. ============================================== 1. The person concerned is forced to make a clear and comp- lete statement of the problem. 2. The table is easy to read and use. 3. Decision tables allow a problem to be segmented, each segment being represented by a separate table. 4. Condition tests are separated from actions to be taken, making it easy to isolate the set of conditions which hold. 5. The table presents a standard format which immediately shows up any anomalies. 6. Tables are easy to modify and maintain. 7. A table can readily provide input to a program which will permit direct coversion to a computer program. 8. The decision table permits a problem to be fully recorded without imposing a particular sequence of operations on its solution. A computer consultant who has used Decision tables rather than flow charts as a means of communication between Analysts and programmers makes the following claims:- 1. Provide clear communication of the requirements to the programmer. 2. Clear connection between the program written and the sys- tem required. 3. Simplicity of coding decreasing the work load on the dep- leted programming staff. 4. Ease of checking logic of program written. 5. Capability of splitting long programs into modules. DECISION TABLE IMPLEMENTATION IN MACRO - 11. PAGE 150 DECISION TABLE IMPLEMENTATION. ============================== INTRODUCTION. ============= The decision table facility in MACRO-11 allows the user to define program logic in a concise yet powerful manner. FACILITIES AND USES OF DECISION TABLES IN MACRO-11. =================================================== MACRO-11 can process limited or extended entry decision tables. Multiple decision tables may be specified and mixed with 'SUPERMAC' procedures and statements as well as basic macro-11 instructions and linkage may be carried out from conditions (via IF or CALL verbs) or actions (via CALL,GOTO,REPEAT,EXIT verbs). Supermac statements, actions and conditions may be mixed in any order in decision tables but decision tables cannot be nested within each other, though a decision table can be nested within an IF,THEN,ELSE statement. All 'MACRO-11' and 'SUPERMAC' arithmetic operations can be perf- ormed (LET statement). Else rules can be defined. INTERPRETATION OF MACRO-11 DECISION TABLES. PAGE 151 INTERPRETATION OF MACRO-11 DECISION TABLES. =========================================== Decision tables in MACRO-11 are interpreted using a rule mask technique. When the DETAB MACRO is defined it sets up 2 words, one which sets the else rule and one with all bits set, whose bits will be cleared as the results of condition checks. Each condition is evaluated serially and actions corresponding to the rule or rules satisfied are carried out in turn. It is important to note that MACROS will process decision tables in which more than one rule is satisfied. Consider the following decision table. C. IF SEX EQ MALE [ Y - ELSE C. IF AGE GT #21 [ - Y - A. LET COLUMNS:= SPACE [ X X X A. LET COL1 := "*" [ X - - A. LET COL2 := "*" [ - X - A. LET COL3 := "*" [ - - X Assuming the data presented consists of:- NAME - Edwards sex - male age - 18 Thomas female 30 Jones female 16 Jenkins male 35 - then the output produced is as follows:- NAME COL1 COL2 COL3 Edwards * Thomas * Janes * Jenkins * * INTERPRETATION OF MACRO-11 DECISION TABLES. PAGE 152 Having evaluated the two conditions for 'Edwards' MACRO would find that only rule 1 can be satisfied. For 'Thomas' and 'James' rule 2 and the ELSE rule are satisfied respectively, in the case of 'Jenkins' after evaluating the two conditions it is found that rules 1 and 2 are both satisfied. This is a situation where more than one rule is satisfied. MACRO processes the actions by working serially through the actions and carrying out any actions which have at least one X specified in a satisfied rule. Thus the first action to spacefill the columns is performed. Then an * is moved to column 1 and an * is also moved to column 2. Note that this method implies only one pass through the table; i.e. Macro decis- ion tables does NOT process the conditions and actions for rule 1 (if satisfied) --- and then return to the start of the table to process the conditions and actions for rule 2. It is important that the reader appreciates that MACRO decision tables are inter- preted in this way. Relevance testing has been incorparated for all decision table verbs and macros. INCOMPLETE DECISION TABLES. PAGE 153 INCOMPLETE DECISION TABLES. =========================== An incomplete discision table is one in which not all possible combinations of conditions are catered for. Example:- ========= C. IF RECTYPE EQ #20 [ Y Y Y C. IF PRODCODE EQ #121 [ Y N N C. IF PRODGP EQ #2 [ - Y N A. GOTO TABA [ X X - A. GOTO TABB [ - - X The above table is incomplete as the rule for the case where RECTYPE is not equal to 20 has been omitted. An incomplete decis- ion table can always be completed by the addition of an ELSE rule. Decision table MACROS will process an incomplete decision table by always providing an ELSE rule which is entered when no other rule is satisfied. Reaction IGNORE is supplied by the MACROS for this implied ELSE rule. The above decision table is interpreted as if it were. C. IF RECTYPE EQ #20 [ Y Y Y ELSE C. IF PRODCODE EQ #121 [ Y N N - C. IF PRODGP EQ #2 [ - Y N - A. GOTO TABA [ X X - - A. GOTO TABB [ - - X - A. IGNORE [ - - - X The rule supplied by MACRO for any incomplete decision table is known as the implied ELSE/IGNORE action. The results, when the implied ELSE rule is satisfied in the above example is to by-pass the actions to the next in-line instruction. If the DETEND macro is used then the 'error bit' will be set and a RETURN generated. MACRO DECISION TABLE FORMATS. PAGE 154 MACRO DECISION TABLE FORMATS. ============================= This section describes the format and rules governing the use of decision tables in MACRO. Basically these consists of four MACROS (DETAB / C. / A. /DETEND) DETAB name,global/local ----- Each decision table is introduced by this directive in the above format. Name is optional and may be any MACRO-11 valid format, type may be either local or global and if not specified, local is assumed. 'DETAB' also sets up the appropriate mask words and repeat label. Following the DETAB macro the user may specify other macros, instructions, conditions or actions. Macros and macro instructions will be actioned regardless and can be considered as INITIAL or GENERAL actions. There is no limit to the number of details which may be specified as initial actions, conditions or actions. There is a limit to the number of rules which may be specified in a MACRO decision table. No more than 16 rules may be specified, including an explicit or implicit ELSE rule. Comments may be made in the standard MACRO way, namely following a semi-colon. ......CONDITIONS. PAGE 155 CONDITIONS. =========== Format:- C. test [ rules. The 'test' will normally be done with a SUPMAC 'IF' statement such as IF R0 EQ R1, or it can be a Procedure, Detab or Label 'call'; or a macro that returns SUCCESS or ERROR. Note that IF may be used in place of CALL. The '[' is a delimiter used in both conditions and actions to seperate the test or action from the rules. The following items may appear in the rules section of a limited entry MACRO decision table. Y, S, T for YES, Success or True. N, E, F for NO, Error or False. - or . for irrelevant or immaterial. ELSE for the ELSE rule. ELSE may only appear in the last rule of the first condition and only - or . may appear in this rule for the remaining condition entries. ......ACTIONS/DETEND. PAGE 156 ACTIONS. ======== Format:- A. action [ rules. The 'action' can consist of any standard macro instruction or macro with a limit of 5 additional parameters. After the delimiter ([) the items allowed in the rules (action entry) of a limited entry MACRO decision table are. X for perform the action. - or . for do not perform the action. If the entry is blank the action macro assumes an X is required for every rule. DETEND. ======= This is an optional terminator for a decision table, if one or more rules, other than ELSE are true, then its sets the success flag and issues a RETURN or if ELSE it sets the error flag and issues a RETURN. Exiting can be programmed by using the following macros. EXITTRUE / EXITSUCCESS / EXIT T / EXIT S - success return. EXITFALSE / EXITERROR / EXIT F / EXIT E - error return. GOTO name - unconditional branch. REPEAT - control returns to start of present detab. ......EXTENDED ENTRIES. PAGE 157 EXTENDED ENTRIES. ================= A facility included in MACRO-11 decision tables is that of extended entries, where in both conditions and actions one parameter can be extended into the rules section. Consider the following table. C. IF R0 EQ #1 [ Y - - ELSE C. IF R0 EQ #2 [ - Y - - C. IF R0 EQ #3 [ - - Y - A. CALL ONE [ X - - - A. CALL TWO [ - X - - A. CALL THREE [ - - X - In extended entry form this may be re-written as follows. C. IF R0 EQ ? [ #1 #2 #3 ELSE A. CALL ? [ ONE TWO THREE - In the condition, only the true test is made, for example compare the two tables. In an extended macro or call validity checks are made first, even in a condition, thus all conditions may not be actioned. Only one (but any) parameter, may be extended and is marked by a question mark. DECISION TABLE EXAMPLE. PAGE 158 EXAMPLE. ======== This is not a practicle example but attempts to show all macro formats. Consider as possible statements. DETAB FIRST,GLOBAL. SAVE R1,R2,R3 C. IF R0 EQ #1 [ Y Y - - ELSE C. IF R0 EQ ? [ - - #2 #3 - SAVE R0 A. LET R0 := ? [ #4 #5 #6 #7 - C. CALL ONE [ - Y Y - - C. IF ONE [ - Y Y - - C. IF ? [ ONE TWO THREE FOUR . A. TLOOKUP R0,DSPMEM [ X X X X . A. CALL INITIALISE [ . X . . . A. MOV ?, R0 [ R1 R2 R3 . . UNSAVE R1,R2,R3,R0 DETEND. DEBUGGING & TRACING FACILITIES. PAGE 159 DEBUGGING FACILITIES ==================== THESE CAN ALSO BE USED IN 'SUPER-MAC' AND OTHER MACROS. LISTING FACILITIES ================== By using the word LIST and NOLIST around sections of program will cause the actual Macro generated code to be output to the list- ing file. Consider it as a Switch. TRACING FACILITIES ================== By using the terms TRACE and NOTRACE around program modules at run time the label will be printed on the VDU every time that - LABEL is passed. In the case of a Decision Table then the LABEL name will be given when the first action is reached and the rules true at that time will be printed. CHAPTER 15 STRING HANDLING MACROS. INDEX 1 INTRODUCTION. PAGE 161 2 STRING MACROS PAGE 162 3 CHARACTER / STRING MACROS PAGE 168 INTRODUCTION. PAGE 161 STRING HANDLING MACROS. ======================= The following macros allow for easy manipulation of strings and the following notes should be born in mind. To make parameter passing easy from one macro to another a number of locations have been defined. Macro parameters are loaded into these locations and if a par -ameter is a location it can be defaulted by the use of a '-'. In add -ition the results of any macro action will also be loaded in these locations and the 'C' bit appropriatly set. Thus the programmer does not have to bother about registers as all register values are retained when these MACROS are used. The parameter passing locations may be accessed seperatly and those loaded or used are given for each macro. All locations use 'CD.' (COMMON DICTIONARY) for the first three characters. All parameters must be defined or on error will result. LABEL parameter _ string label or register holding a string address. (CD.SRC/CD.DST) SOURCE parameter _ a source string defined the same as label. (CD.SRC) DESTINATION parameter _ a destination string defined the same as label. (CD.DST) CHARACTER parameter _ number, register or label defining an ascii character. (CD.CHR) COUNT parameter _ a number, register or label holding a numeric count (CD.CNT) POSITION parameter _ a number, register or label holding a number giving a character position within a string.(or table KEY). (CD.POS/CD.KEY) In order to obtain a parameter from the Common Dictionory a dash (-) must be used for that parameter. No parameter must be left undefined or an error will result. STRING MACROS PAGE 162 ZPAD. label,count ---- This macro fills up the remainder of a string with nulls, or appends the number of spaces specified in 'COUNT'. It does not clear the string first. Parameter locations:- ------------------- CD.SRC holds the string address. CD.CHR := #0 CD.CNT := characters inserted or "#0" for whole string. success/error SPPAD label,count ----- This macro fills up the remainder of a string with spaces, or appends the number of spaces specified in 'COUNT'. It does not clear the string first. Parameter Locations:- ------------------- CD.SRC holds the string address. CD.CHR := #40 (space) CD.CNT := characters inserted or "#0" for whole string. success/error PAD label,character,count --- This macro pads out a string with the number of specified characters, or appends the number of characters specified as defined in count. It does not clear the string first. Parameter locations:- ------------------- CD.SRC holds the string address. CD.CHR holds the ascii character value. CD.CNT holds the number of characters to pad with. success/error STRING MACROS PAGE 163 ADDSTRING source, destination --------- This macro appends the source string to the destination string or as much as there is room for, the source string remains unaltered. Parameter Locations:- ------------------- CD.SRC holds the source string address. CD.DST holds the destination string address. success/error CLRSTRING label --------- This macro fills the string with nulls and clears the string count. Parameter Locations:- ------------------- CD.SRC holds the string address success/error MOVSTRING. source, destination. ---------- This macro is a combination of the CLRSTRING and ADDSTRING, macrosIt clears the destination string and moves the source string to the destination string. Parameter Locations:- ------------------- CD.SRC holds the source string address. CD.DST holds the destination string address. success/error STRING MACROS PAGE 164 CMPSTRING source, destination --------- This macro compares two strings exact and the status bits are set dependant on the result. NOTE:- If the strings are of different lengths then the characters are compared over the length of the shortest string. If all characters are the same the shortest string is considered smaller. Parameter Locations:- ------------------- CD.SRC holds the source string address. CD.DST holds the destination string address. Result Locations:- ---------------- CD.RES holds the result If CD.RES = 0 (success) - both strings identical = positive (error) - source string largest = negative (error) - destination string largest Alternative result testing (SUPERMAC) :- ------------------------------------- IF RESULT IS SUCCESS (both strings identical) IF RESULT IS ERROR (strings are not the same) IF RESULT IS GT (source string largest) IF RESULT IS LT (destination string is largest) IF RESULT IS EQ (strings not identical - but the length is the same) success/error STRING MACROS PAGE 165 ROLSTRING label --------- This macro shifts a string one place to the left (ROLL LEFT). The last character in the string is moved to the start of the string. Parameter Locations:- ------------------- CD.SRC holds the label string address. success/error RORSTRING label --------- This macro shifts a string one place to the right (ROLL RIGHT) The first character in the string is moved to the end of string. Parameter Locations:- ------------------- CD.SRC holds the label string address. success/error SHLSTRING label --------- This macro shifts a string one place to the left, removing the first character. Parameter Locations:- ------------------- CD.SRC holds the label string address. Result Locations:- ---------------- CD.CHR holds the first character removed success/error STRING MACROS PAGE 166 SHRSTRING label,character --------- This macro shifts a string one place to the left, putting the defined character in the vacated first character slot. Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.CHR holds the ascii character. success/error SUBSTRING source, destination --------- This macro locates the source string within the destination string and if there it subtracts it from the destination string. The source string remains untouched. Parameter Locations:- ------------------- CD.SRC holds the source string address. CD.DST holds the destination string address. Result Locations:- ---------------- CD.POS holds the position in destination string where the source was found CD.CNT holds the number of characters deleted. success/error. STRING MACROS PAGE 167 SWABSTRING label ---------- This macro swaps or reverses all the characters held in a string. Parameter Locations:- ------------------- CD.SRC holds the label string address. success/error. TSTSTRING label --------- This macro allows a string lenght to be acted upon by appropriatly setting the status word condition codes. Parameter Locations:- ------------------- CD.SRC holds the label string address. Result Locations:- ---------------- CD.RES holds the string lenght. CHARACTER / STRING MACROS PAGE 168 THE FOLLOWING MACROS DEAL WITH CHARACTERS WITHIN STRINGS. ========================================================= ADDCHRSTRG character, label ---------- This macro adds or appends a character to a string. Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.CHAR holds the character to be added. INSCHRSTRG character, position, label ---------- This macro inserts a character within a string at a given position (insert after). Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.CHR holds the character to be inserted. CD.POS holds the position to be inserted after. success/error. MODCHRSTRG character, postiion, label ---------- This macro modifies a character within a string at a given position. Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.CHR holds the character which is modifying. CD.POS holds the position of character to be modified. success/error. CHARACTER / STRING MACROS PAGE 169 DELCHRSTRG position, label ---------- This macro deletes or removes a character from a given position within a string. Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.POS holds the position where character is or has been deleted. success/error. POPCHRSTRG label ---------- This macro removes the first character from a string and leaves it in CD.CHR. Parameter Locations:- ------------------- CD.SRC holds the label string address. Results Locations:- ----------------- CD.CHR holds the first character removed. success/error. PUSHCHRSTRG character, label ----------- This macro inserts a character ( byte ) at the begining of a string. Parameter Locations:- ------------------- CD.SRC holds the label string address. CD.CHR holds the character to be inserted. Result Locations:- ---------------- CD.POS becomes equal to #0 CHAPTER 16 General purpose macros INDEX 1 Print macros PAGE 171 2 Input / read macros PAGE 173 3 Initialisation and Terminaltion macros PAGE 174 4 General utility macros PAGE 175 5 Utility Terminal format presentation macros PAGE 178 6 MX12 modules PAGE 179 7 Status control macros PAGE 180 Print macros PAGE 171 MACROS TO BE FOUND IN MAC/LIB ----------------------------- Note parameters in [square brackets] are optional. MODULE NAME DESCRIPTION ------ ---- ----------- MX08 PRINT [label],[character string] Output a character string to the terminal If the character string is not specified the string for output is assumed to be pointed at by R0. eg. PRINT ,<"DEMO TEXT"> ;PRINT TEXT PRINT XX,<"DEMO 1"> ;PRINT TEXT, LAB XX: APPENDED TO TEXT PRINT XX ;PRINT TEXT AT LABEL XX MX08 PRINTA [label/location],[BYTE] This macro outputs either the contents of R0 (by default) or contents of label to the terminal in ASCII representation. All bytes/characters decsribed by two ASCII characters to cover non-printing characters NB. 1 would be displayed as ^A and the erase character as ^% all printing characters preceded by a space. eg. PRINTA XX ;CONTENTS OF XX DISPLAYED AS 4 CHARACTERS MX08 PRINTC [character],[BYTE] Output a character to the terminal. If the character is not specified the character for output is assumed to be held in R0. eg. PRINTC #65. ;PRINT THE CHARACTER "A" eg. PRINTC @#ODDADDRESS,BYTE Print macros PAGE 172 NAME MODULE DESCRIPTION ---- ------ ----------- MX08 PRINTB [label/location],[BYTE] This macro outputs either the contents of R0 (by default) or the contents of the lable to the terminal in BASE 2 ASCII converted form. eg. PRINTB #-1 ;output = 1111111111111111 eg. PRINTB #-1,BYTE ;output = 00000000 MX08 PRINTD [label/location],[BYTE] This macro outputs either the contents of R0 (by default) or the contents of the label to the terminal in DECIMAL form. eg. PRINTD #65. ;PRINTS THE VALUE IN FORM +00065 eg. PRINTD @R0,BYTE ;R0 POINTS TO AN ODD ADDRESS MX08 PRINTH [label/location],[BYTE] This macro outputs either the contents of R0 (by default) or the contents of the lable to the terminal in BASE 16 ASCII converted form. eg. PRINTH #-1 ;output = FFFF eg. PRINTH #-1,BYTE ;output = FF MX08 PRINTO [label/location],[BYTE] This macro outputs either the contents of R0 (by default) or the contents of the label to the terminal in OCTAL form. eg. PRINTO #101 ;PRINTS THE VALUE IN THE FORM 000101 eg. PRINTO (R2)+,BYTE MX08 PRINTR [label/location] This macro outputs either the contents of R0 (by default) or the contents of the label to the terminal in RADIX 50 form. eg. PRINTR #^RABC ;PRINTS THE VALUE IN THE FORM CCC MX08 REPCHAR character,repeat count This macro set up the data in the form suitable to be processed by the procedure V$TXC. eg. REPCHAR ,33 ;OUTPUT 33 SPACE CHARACTERS MX08 PTEXT string This macro set up the string in the form suitable to be processed by the procedure V$TXB. .eg PTEXT <"HAVE A NICE day">;SEND TEXT TO TERMINAL Input / read macros PAGE 173 MODULE NAME DESCRIPTION ------ ---- ----------- MX10 INPUT [string] Read a character string from the terminal the address of the characters string is placed in R0 by default or the named string. eg. INPUT A$ ;READ CHARS FROM TERMINAL AND PUT IN STRING A$ MX10 INPUTNE [string] Read a character string from the terminal with the no echo option. The address of the character string is placed in R0 by default or the character are copied into the string. .eg INPUTNE A$ ;AS INPUT BUT CHARS NOT ECHOED ON TERMINAL Initialisation and Terminaltion macros PAGE 174 MODULE NAME DESCRIPTION ------ ---- ----------- MX07 INITIALISE [Lun number],[VDU event flag number] This must be the first macro to be used it initialises the terminal input output software. If file handling software is being used the default lun (one) can be set to any value, likewise the vdu event flag default (one) can also be altered. MX07 TERMINATE [status reply] This should be the last instruction in the program it closes down the terminal channel in an orderly manner. The valid status replys are :- SUC indicating success WAR indicating a warning ERR indicating an error has occured SEV indicating a severe error has occured eg. TERMINATE SUC ;INDICATE JOB SUCSESSFUL General utility macros PAGE 175 MODULE NAME DESCRIPTION ------ ---- ----------- MX04 SAVE [list of registers locations] This macro in the default mode saves the following registers on the stack R0,R1,R2,R3,R4 and R5. (R$SAVE) Otherwise the named registers will be saved on the stack. eg. SAVE R0,R3,R5 ;SAVE REGISTERS ON STACK MX04 UNSAVE [list of registers/locations] This macro performs the reverse operation of the macro SAVE ie. if no register/locations specified then registers R0,R1,R2,R3,R4 and R5 (R$UNSAVE) will be restored. Otherwise the named registers/locations will be restored from the stack. Note the order for the parameters of The macros SAVE and UNSAVE must be the same. eg. UNSAVE R0,R3,R5 ;RESTORE REGISTERS IN ORDER R5,R3,R0 MX01 STRING Text,Label[,Control] This macro reserves a text string associated with the label and with write access denied. It has been found that sometimes a string is required that exceded that that can easily be typed onto a single line therfore a continuation option is allowed using the control parameter. The following control words are allowed FIRST indicating the start of the string, CONT indicating a continuation of the string but not the last segment and LAST used to terminate the string. Note that the Location/Register field may be ignored when using CONTROL = CONT or CONTROL = LAST. eg. STRING <"LOAD THESE CHARACTERS INTO STRING A$">,A$ eg. STRING <"First line">,B$,FIRST STRING <"continuation line">,,CONT STRING <"further continuation">,,CONT STRING <"at last the end">,,LAST MX01 RESERVE Size,Label This macro reserves a blank string associated with the label set with read/write access and limited to maximum number of characters size. eg. RESERVE 100.,A$ ;SAVE SPACE FOR STRING A$ 100 CHARS LONG General utility macros PAGE 176 MODULE NAME DESCRIPTION ------ ---- ----------- MX01 MOVTEXT String,Location/Register[,Control] This macro enable the programmer to assign a character string to a register or load the string address into a location. The [,Control] option allows you to create strings that would normally exceede the length of a 80 column line and so distort the MACRO 11 compiler listings. The [,Control] may be one of three words allowed FIRST indicating the start of the string, CONT indicating a continuation of the string but not the last segment and LAST used to terminate the string. Note that the Location/Register field may be ignored when using CONTROL = CONT or CONTROL = LAST. eg. MOVTEXT <"Have a nice day">,R0 eg. MOVTEXT <"First line">,R2,FIRST MOVTEXT <"continuation line "<10.><13.>>,,CONT MOVTEXT <"further continuation"<12><15>>,,CONT MOVTEXT <"at last the end">,,LAST MX01 QUEBUF size,label This macro reserves a data area in queue buffer format with the label associated with the data area. eg. QUEBUF 100.,A. ;SAVE SPACE FOR QUEUE CALLED A. 100 CHARS LONG General utility macros PAGE 177 NAME MODULE DESCRIPTION ---- ------ ----------- MX01 PRESET Size,label[,aa][,bb][,cc] This macro reserves a preset string. Note the parameter size may be overwritten by the effect of parameters [aa],[bb],[cc]. The parameter label is the label by which the character string is to be accessed. Three parameters specified -------------------------- The parameter [aa] is the string to be loaded into the preset area. Four parameters specified ------------------------- The parameter [aa] is the string to be loaded into the preset area and parameter [bb] is the number of repeats of string [aa] required. Five parameters specified ------------------------- The parameter [aa] is now a value NOT A STRING , parameter [bb] is the repeat count and parameter [cc] is a step value on the entry value [aa]. Utility Terminal format presentation macros PAGE 178 MODULE NAME DESCRIPTION ------ ---- ------------ MX09 NEWLINE [Number of newlines] This macro causes a newline to be displayed on the terminal. MX09 SPACES [Number of spaces] This macro causes a number of spaces to be displayed on the terminal. MX11 DUMP Comment,value This macro prints out a newline followed by the specified comment and the value entry printed both in decimal and octal. MX11 DEBUG Comment,[errlab],[level] This macro in not yet available. MX12 modules PAGE 179 COMMON INFORMATION for MX12 modules. ------------------------------------ The parameter SIZE indicates the number of bytes to be processed and may be any one of the following values 1,2,4,6 The parameter FORMAT may be any one of the following symbols RAD for radix 50 display, ASC for ascii representation DEC for decimal display or OCT for an OCTAL display. All these MACRO's may require the use of the register R4. MX12 DMPOFF OFFSET,SIZE,[FORMAT] This macro displays the OFFSET and the contents of the location pointed at by (R4 + the OFFSET) to the display in the format specified. The default format is OCTAL. MX12 DMPSYM SYMBOL,SIZE,[FORMAT] This macro displays the SYMBOL and the contents of the symbol in the format specified. The default format is OCTAL. The parameter SIZE is limited to 1,2 only. MX12 DMPBIT FLAG,[mask] This macro displays the FLAG and the logical state of the flag. The mask option allow a controlled area to be checked. The flag bits are required to be held in register R4. Usage MOV @DATA,R4 DMPBIT TF.RNE DMPBIT TF.TMO Status control macros PAGE 180 MODULE NAME DESCRIPTION ------ ---- ----------- MX06 SETERROR [branch label] This macro set the C bit indicating an error condition. If branch label is specified a branch will take place to the specified label. MX06 SETSUCCESS [branch label] This macro clears the C bit indicating a successful operation. If branch label is specified a branch will take place to the specified label. MX06 EXITERROR This macro sets the C bit and then returns to the calling routine via RTS PC. MX06 EXITSUCCESS This macro clears the C bit and then returns to the calling routine via RTS PC. MX06 IFERROR label This macro tests the C bit and if it is set a branch to label takes place. The symbol label may be replaced by the word RETURN if RTS required on error condition. MX06 IFSUCCESS label This macro tests the C bit and if it is clear a branch to label takes place. The symbol label may be replaced by the word RETURN if RTS required if successfull operation. NOTE:- EXIT T [EXITSUCCESS] EXIT F [EXITERROR] EXIT S [EXITSUCCESS] EXIT E [EXITERROR] CHAPTER 17 TABLE HANDLING MACROS. INDEX 1 INTRODUCTION. PAGE 182 2 TABLE MACROS PAGE 184 3 SEQUENCED TABLE MACROS. PAGE 186 INTRODUCTION. PAGE 182 TABLE HANDLING MACROS. ====================== The following macros allow for easy manipulation of tables and the following notes should be born in mind. To make parameter passing easy from one macro to another a number of locations have been defined. Macro parameters are loaded into these locations and if a par -ameter is a location it can be defaulted by the use of a '-'. In add -ition the results of any macro action will also be loaded in these locations and the 'C' bit appropriatly set. Thus the programmer does not have to bother about registers as all register values are retained when these MACROS are used. The parameter passing locations may be accessed seperatly and those loaded or used are given for each macro. All locations use 'CD.' (COMMON DICTIONARY) for the first three characters. All parameters must be defined or an error will result. LABEL parameter _ string label or register holding a string address. (CD.SRC/CD.DST) SOURCE parameter _ a source string defined the same as label. (CD.SRC) DESTINATION parameter _ a destination string defined the same as label. (CD.DST) CHARACTER parameter _ number, register or label defining an ascii character. (CD.CHR) COUNT parameter _ a number, register or label holding a numeric count (CD.CNT) POSITION parameter _ a number, register or label holding a number giving a character position within a string.(or table KEY). (CD.POS/CD.KEY) In order to obtain a parameter from the Common Dictionory a dash (-) must be used for that parameter. No parameter must be left undefined or an error will result. The table handling macros can be intermixed with the 'string handling macros as they both use the 'COMMON DICTIONARY LOCATIONS'. INTRODUCTION. PAGE 183 For setting up 'Table' areas (see 'Tableblock') then a common area calles 'TABLEBLOCK' must be defined once and then each seperate table. Example:- ======= TABLEBLOCK ; DSPMEM:: TABLE 6000. FPLANS:: TABLE 2000. ; The above example defines 2 tables, one of 6000 bytes and one of 2000 bytes. In program each table is set up by putting the 'Table Label' in the 'TABLE' parameter location. In order to calculate the 'TABLE SIZE' required in bytes,take the average string length (in bytes) add 12 and multiply it by the maximum number of strings. DEFAULTS ('-') ALTERNATIVES ============== ============ KEY CD.KEY 'Location' 'Register' (holding the address) FIRST PREVIOUS PRESENT NEXT LAST ALL (TKILL) DESTINATION CD.DST 'label' 'Register' (holding the address) SOURCE CD.SRC NULSTG (TINSERT) 'label' 'Register' (holding the address) LENGTH CD.CNT 'Location' 'Register' TABLE MACROS PAGE 184 TLOOKUP KEY,TABLE ======= This macro looks up a string in the table defined and returns its address. ON SUCCESS (string located) CD.KEY Holds the key. CD.SRC Holds the table string address ON ERROR (string not found) CD.KEY Holds the key. TREAD DESTINATION,KEY,TABLE ===== This macro looks up a string with the given key in the table and if successful it copies the string to the destination given. ON SUCCESS CD.KEY Holds the key. CD.SRC Holds the table string address. CD.DST Holds the destination string address. TWRITE SOURCE,KEY,TABLE ====== This macro looks up a string with the given key in the table and if successful it writes the source string into it, any previous onformation being overwritten. If the string will not fit, it will be truncated. ON SUCCESS CD.KEY Holds the key. CD.SRC Holds the input string address. CD.DST Holds the table string address. TKILL KEY,TABLE ===== This macro deletes a string with a given key from the table. If 'ALL' is in place of 'KEY' then it performs as TCLOSE and re- initialises the table. ON SUCCESS (String deleted.) ON ERROR (String not found.) TABLE MACROS PAGE 185 TCREATE LENGTH,KEY,TABLE ======= This macro creates a string with the given key within the table. 'LENGTH' is the maximum number of bytes required. ON SUCCESS CD.KEY Holds the key. CD.SRC Holds the table string address. CD.CNT Holds the length. ON ERROR (String already created.) CD.KEY Holds the key. CD.SRC Holds the table string address. CD.CNT Holds the length. TPROTECT KEY,TABLE ======== This macro if successful marks a string as DELETE/WRITE pro- tected, except for 'TCLOSE' which operated regardless of protection. ON SUCCESS CD.KEY Holds the key. CD.SRC Holds the table string address. ON ERROR CD.KEY Holds the key. TUNPROTECT KEY,TABLE ========== This macro if successful marks a string as unprotected. ON SUCCESS CD.KEY Holds the key. CD.SRC Holds the table string address. ON ERROR CD.KEY Holds the key. SEQUENCED TABLE MACROS. PAGE 186 SEQUENCED TABLE ACCESS. ======================= The following macros maintain the keys in a sequenced order starting at '1'. Re-sequencing of the keys occurs automatically which makes them very useful for sorting strings. TINSERT SOURCE,LENGTH.KEY,TABLE ======= This macro allows for the insertion of a string within the table. If we have a string whose keys run from 1 to 5 and we wish to insert a string whose key is 4 the keys to strings 1 to 3 remain the same, string 5 becomes string 6 and string 4 becomes string 5 and the new string is inserted. If a string with the same key does not exist then it is created and then all keys are automatically re-sequenced from 1. 'NULSTG' is used in place of the source then an empty string will be created of the length specified. CD.KEY Holds the key. CD.SRC Holds the source string address. (if defined) CD.DST Holds the inserted table string address. CD.CNT Holds the maximum length of the string. TREMOVE KEY,TABLE ======= This macro is the same as 'TKILL' except that the table is automatically resequenced after the string has been removed. CD.KEY Holds the key. TCLOSE TABLE ====== This macro, regardless of the state of protection, re- initialises a string. (deletes all entries) CHAPTER 18 Module Reference Tables. INDEX 1 MACRO modules PAGE 188 2 CORAL Procedures called by section. PAGE 191 3 CORAL procedures used by section PAGE 192 4 MACRO symbol reference tables PAGE 193 MACRO modules PAGE 188 MODULE contents MODULE contents ------ -------- ------ -------- MG0 common macros only MG01 R$ADDRESS MG02 V$IO MG03 V$INPUT MG04 V$TX MG05 R$SWAP MG06 R$BITSET MG07 R$BITPOS MG08 V$ON V$OFF MG09 V$TXA MG10 V$TXB MG11 V$TXC MG12 V$TXD MG13 R$PARITY MGD1 VDU common data areas MGD2 VDU fixed data areas MR01 R$BDEC MR02 R$BOCT MR03 R$BINB R$DECB R$HEXB R$OCTB R$STRB MR04 R$DELETE MR05 R$POS3 R$POS2 R$POS MR06 R$WEDGE MR07 R$REVERSE MR08 R$SHRE MR09 R$SHLE MR10 R$SHR R$SHL MR11 R$COMPARE MR12 R$ADDTO MR13 R$CLEAR MR14 R$SEG MR15 R$BR50 MR16 MR17 R$R50L MR18 R$BASC MR19 R$UIC MR20 R$CLK R$DAT MR21 R$NTDY MR22 MR23 R$QADD MR24 R$QREM MR25 R$QTST MR26 R$BHEX MR27 R$BBIN MR28 MRC01 R$GETC MRC02 R$MODC MRC03 R$ADDC MRC04 R$INSC MRC05 R$DELC MRC06 R$POSC R$POSS MRC07 R$MOVC MRC08 R$CR50 R$R50C MRC09 R$CMPC MRC10 R$LCUC MRC11 R$UCLC MRC12 MRC13 MRC14 MRC15 MRC16 MACRO modules PAGE 189 MODULE contents MODULE contents ------ -------- ------ -------- MN01 N$DIAG MN02 N$DUMP MN03 N$INIT MN04 N$SEEK MN05 N$FIRST N$LAST N$PRESENT MN05 N$SETUP MN06 N$DELETE MN07 N$NEXT MN08 N$PROTECT N$UNPROTECT MN09 N$CREATE MN10 N$SQUEEZE MN11 MN12 MN13 MN14 MT01 T$DIAG MN02 T$DUMP MT03 T$INIT MT04 T$SEEK MT05 T$FIRST T$LAST T$PRESENT MT05 T$SETUP MT06 T$DELETE T$DKEY MT07 T$NEXT T$PREVIOUS MT08 T$PROTECT T$UNPROTECT MT09 T$CREATE T$SCHK T$IKEY MT10 T$SORT T$SQUEEZE MF01 F$NAME MF02 F$GETR MF03 F$SHUT MF04 F$PUTR MF05 F$OPEN MF06 F$SETUP MF07 F$DIAG MF08 F$SWITCH MFD1 FCS COMMON DATA AREAS MX01 STRING PRESET RESERVE MOVTEXT QUEBUF MX02 MESSAGE MFUNCTION REPORT MX03 NODEBLOCK TABLEBLOCK MX04 SAVE UNSAVE MX05 FLODEF BITDEF FNAMDEF FILEFUN MX06 SETERROR SETSUCCESS EXITERROR EXITSUCCESS IFERROR IFSUCCESS MX07 INITIALISE TERMINATE MX08 REPCHAR PTEXT PRINT PRINTA PRINTC PRINTD PRINTO PRINTR MX09 NEWLINE SPACES MX10 INPUT INPUTNE MX11 DUMP DEBUG MX12 DMPOFF DMPSYM DMPBIT MX13 TABMAC (ALL) MX14 SUPERMAC MACROS (ALL) MX15 TABLE ACCESS MACROS MX16 STRING MACROS AND GENMAC MX17 SERIAL I/O MACRO MX18 RT-11 MACROS (ALL) MACRO modules PAGE 190 MODULE contents MODULE contents ------ -------- ------ -------- MMC01 M$CHECK MCC01 C$DECINT MC01 LEN MC02 COMPARE MC03 SEG MC03A LSEG MC04 COPY MC05 POS LPOS MC06 MC07 VDU MC08 MC09 MC10 VAL MC11 MC12 MC13 MC14 MC15 MC16 ADDTO MC17 MC18 MC19 MC20 MC21 CLEAR MMTD1 MAGTAPE COMMON DATA AREAS MMT01 MT$EXIT MMT02 MT$GET MMT03 MT$SHUT MMT04 MT$PUT MMT05 MT$OPEN MMT06 MT$FIND MMT07 MT$BACK MMT08 MT$REWIND MMT09 MT$MARK MMT10 CORAL Procedures called by section. PAGE 191 REF NAME PROCEDURES CALLED L01 LEN L02 COMPARE L01 L03 SEG L01 L03A LSEG L01 L04 COPY L01 L05 POS L01 L02 L05A LPOS L01 L02 L06 ADD L01 L04 L07 VDU L03A L05A L07A L10 QIO WAITEF L07A VDUOUT L05A L7B L7G L07B VDUTX L07G Q10 WAITEF L07C RTO4 L03A L05A L07E L10 QIO WAITEF DEFLUN RELEASE L07D VDUSP L03A L05A L07A L07G L10 QIO QIOAST WAITEF [VDUAST] L07E RTOUT L05A L07B L07G VDULUN L07L DEFLUN RELEASE VDUFLG L07L LUNTEST LUNBOOK LUNFREE L07S SYS QIO VDUFLG VDULUN WAITEF L08 STR FCHAR AINT L09 ASC L10 VAL L01 L11 FILEIN READREC L11A LFILEIN READREC L12 FILEOUT L01 WRITEREC L13 CHR L14 QUOTE L15 FILE L01 L03A L04 L05A L07 L08 L10 L16 DEFLUN CREATE DELETE OPEN CLOSE RELEASE L16 ADD TO L01 L17 A SPACE L18 A TAB L19 FILL L01 L03A L16 L20 CRLF L21 CLEAR L22 DAT L04 L08 L16 L17 GETTIM L23 CLK L04 L08 L16 L17 GETTIM L24 TABLOAD L01 L25 RADASC L26 ASCRAD L27 TERMINAL L05A L28 COMSORT L01 L29 CHARVER L01 L30 MULS L16 L31 CVT L01 L03A L04 L05A L06 L10 L13 L16 L21 L29 L30 L32 AINT L32 SRP L01 L03A L05A L16 L21 L33 CYPHER L01 L03A L04 L05A L16 L21 CORAL procedures used by section PAGE 192 REF NAME USED BY PROCEDURE L01 LEN L02 L03 L03A L04 L05 L05A L06 L10 L12 L16 L19 L24 L28 L29 L31 L32 L33 L02 COMPARE L05 L03 SEG L03A LSEG L07 L07D L19 L31 L32 L33 L04 COPY L06 L15 L22 L23 L31 L33 L05 POS L05A LPOS L07 L07A L07D L15 L27 L31 L32 L33 L06 ADD L31 L07 VDU L15 L07A VDUOUT L07 L07D L07B VDUTX L07A L07E L07C RTO4 L07D VDUSP L07E RTOUT L07C L07G VDUFLG L07A L07B L07D VDULUN L07L LUNBOOK L07G LUNFREE LUNTEST L07S SYS L08 STR L15 L22 L23 L09 ASC L10 VAL L07 L07D L31 L11 FILEIN L12 FILEOUT L13 CHR L14 QUOTE L15 FILE L16 ADD TO L15 L19 L22 L23 L30 L31 L32 L33 L17 A SPACE L22 L23 L18 A TAB L19 FILL L20 CRLF L21 CLEAR L31 L32 L33 L22 DAT L23 CLK L24 TAB LOAD L25 RADASC L26 ASCRAD L27 TERMINAL L28 COMSORT L29 CHARVER L31 L30 MULS L31 L31 CVT L32 SRP L31 L33 CYPHER NOTE:- STRING DATA AREA PROCEDURES USED BY USERS PROGRAMS ONLY. MACRO symbol reference tables PAGE 193 MODULE <-------GLOBAL-------> <---------------CALLED/USED-----------------> NAME SYMBOL SYMBOL SYMBOL SYMBOLS ==== ====== ====== ====== ======= MGD1 R$ADDRESS MGD2 V$IO R$POS2 V$S20 V$00 V$09 V$08 V$TX V$LST V$S16 V$STR V$FUN V$S12 V$S13 V$CNT V$S14 V$S15 R$POS3 C$DECINT V$S17 V$LUN V$EFN V$ISB V$S18 V$01 MG03 V$INPUT V$FUN V$ON V$LUN V$EFN V$ISB V$STR V$CNT V$TX MG04 V$TX R$ADDRESS V$ON V$LUN V$EFN MG05 R$SWAP MG06 R$BITSET MG07 R$BITPOS MG08 V$ON V$OFF V$STA V$LUN MG09 V$TXA V$TX MG10 V$TXB V$TX MG11 V$TXC V$TX MG12 V$TXD V$TX MG13 R$PARITY MGD1 V$STA V$LUN V$EFN V$CNT V$FUN V$ISB V$STR MGD2 V$LST V$00 V$01 V$02 V$03 V$04 V$05 V$06 V$07 V$08 V$09 V$S01 V$S02 V$S03 V$S04 V$S05 V$S06 V$S07 V$S08 V$S09 V$S10 V$S11 V$S12 V$S13 V$S14 V$S15 V$S16 V$S17 V$S18 V$S19 V$S20 MF01 F$NAME F$DFNB R$POSS F$MAXC F$FLG1 R$RSOL F$FLG0 F$FLGO R$CR50 MF02 F$GETR F$FDB .GET MF03 F$SHUT F$FDB .CLOSE MF04 F$PUTR F$FDB .PUT MF05 F$OPEN F$FDB .OPEN MF06 F$SETUP F$FDB F$LUN F$TYPE F$SIZE MACRO symbol reference tables PAGE 194 MODULE <-------GLOBAL-------> <---------------CALLED/USED-----------------> NAME SYMBOL SYMBOL SYMBOL SYMBOLS ==== ====== ====== ====== ======= MMTD1 MT$UNIT MT$LUN MT$EFN MT$DSW MT$ERR MT$ISB MMT1 MT$EXIT $DSW MT$DSW MT$ISB MMT2 MT$GET QIOW$S IO.RLB MT$LUN MT$EFN MT$ISB MT$EXIT MMT3 MT$SHUT ALUN$S $DSW MT$DSW MMT4 MT$PUT QIOW$S IO.WLB MT$LUN MT$EFN MT$ISB MT$EXIT MMT5 MT$OPEN ALUN$S MT$LUN MT$UNIT $DSW MT$DSW MMT6 MT$FIND QIOW$S IO.SPF MT$LUN MT$EFN MT$ISB MT$EXIT MMT7 MT$BACK QIOW$S IO.SPB MT$LUN MT$EFN MT$ISB MT$EXIT MMT8 MT$REWIND QIOW$S IO.RWD MT$LUN MT$EFN MT$ISB MT$EXIT MMT9 MT$MARK QIOW$S IO.EOF MT$LUN MT$EFN MT$ISB MT$EXIT MACRO symbol reference tables PAGE 195 MODULE <-------GLOBAL-------> <---------------CALLED/USED------------------> NAME SYMBOL SYMBOL SYMBOL SYMBOLS ==== ====== ====== ====== ======= MFD1 F$SIZE F$TYPE F$FLG0 F$FLG1 F$MAXC F$LUN F$USED F$FDB F$DFNB F$FDBS MR01 R$BDEC R$REVERSE MR02 R$BOCT R$REVERSE MR03 R$OCTB R$DECN R$STRB R$HEXB R$BINB MR04 R$DELETE MR05 R$POS3 R$POS2 R$POS MR06 R$WEDGE MR07 R$REVERSE MR08 R$SHRE MR09 R$SHLE MR10 R$SHR R$SHL R$SHRE R$GETC R$ADDC R$MODC MR11 R$COMPARE MR12 R$ADDTO MR13 R$CLEAR MR14 R$SEG R$GETC R$ADDC MR15 R$BR50 R$R50C MR16 MR17 R$R50L R$CR50 MR18 R$BASC MR19 R$UIC R$BOCT MR20 R$DAT R$CLK R$BDEC MR21 R$NTDY R$DELC R$SHL MR22 MR23 R$QADD MR24 R$QREMMR25 R$QTST MR26 R$BHEX R$REVERSE MR27 R$BBIN R$REVERSE MRC01 R$GETC MRC02 R$MODC MRC03 R$ADDC MRC04 R$INSC MRC05 R$DELC MRC06 R$POSC R$POSS MRC07 R$MOVC MRC08 R$CR50 R$R50C R$POSC R$GETC MRC09 R$CMPC R$LCUC MRC10 R$LCUC MRC11 R$UCLC MACRO symbol reference tables PAGE 196 MODULE <-------GLOBAL-------> <---------------CALLED/USED-----------------> NAME SYMBOL SYMBOL SYMBOL SYMBOLS ==== ====== ====== ====== ======= MCC1 C$DECINT MC01 LEN R$ADDRESS MC02 COMPARE R$ADDRESS R$COMPARE MC03 SEG R$ADDRESS MC03A LSEG R$ADDRESS MC04 COPY R$ADDRESS R$ADDTO MC05 POS LPOS R$ADDRESS R$POS3 MC07 VDU R$ADDRESS V$IO MC10 VAL R$ADDRESS R$POS2 R$POS3 R$DECINT MC16 ADDTO R$ADDRESS R$ADDTO MC21 CLEAR R$ADDRESS R$CLEAR CHAPTER 19 Utility program XY Plotter emulator. INDEX 1 Introduction PAGE 198 Introduction PAGE 198 This program emulates the following X Y PLOTTER procedures :- TXT MOV PLT CIR RED BLK ARC ARR SQR PLS CRS SIZE NEWFRM The procedure parameters are passed in the following form :- Procedurenameparameter..... The valid delimiters are a space, a comma, a semi-colen or a oblique stroke. (Note multiple delimiters are assumed to be a single delimiter) To use the emulator first construct a text file of the commands required. After the emulator has been run a file call PLOTXY.TMP will have been created which then can be submitted to the XY PLOTTER. CHAPTER 20 Utility program Indexer program. INDEX 1 Introduction PAGE 200 2 Data structures PAGE 201 Introduction PAGE 200 This program has been produced to enable a user to produce a cross-referenced indexed manual with minimal effort. This program will allow the user to control the position of form feeds, to include a Volume title, Chapter titles and Topic titles within each chapter, all these items are build into precedding indexes heading the data they refer too. It is also posible with this program to produce a Global index to item refered to throughout the volume being produced, this index is sorted and appended to the end of the volume with reference page numbers for easy access. This program will start each page with a header containing the page number and a tile. All line will be truncted to 75 characters any remaining text will spill onto the next line. This program uses the SORT-11 sort package. Data structures PAGE 201 All commands for the indexer program are preceded by a single full stop followed by a control function character. NOTE the full stop must be the very first character on the line. ie. .T would produce an entry in the topic index. The commands that are allowed are :- .V This is normally the first entry in the data file .C This enters the chapter title into volume index and starts a new chapter index and contents file .T The enters the title into the chapter index and forces a new page header. .I This enters the item into the global index file. NOTE no more than 40000 items are allowed in the Global index. NOTE index items truncated to 31 characters .F This command causes a new page header to be produced. .B This command causes a page number to be reserved for future insertions so as not to effect the overall page numbering. .! This command allows comments to inserted in the text be not output on the main file. CHAPTER 21 Utility program Simple Upper/Lower case EDITOR INDEX 1 Commands PAGE 203 Commands PAGE 203 When using the character editor a special option has been fitted into this program so as to allow you to monitor the possible commands allowed, when the message COMMAND > appears on the screen you may type the character Z. This character is not used as an editor command therfore the diognostic section will give you a summary of all the posible commands. The following character are the only ones that will perform a legal editing action :- A B C D E F H I L M N P R S T U All commands must be terminated by either a space or by pressing the return key. COMMAND ACTION A Append a series of characters to the end of the present line. The (append) series of characters is terminated by pressing the return key. B Move the line pointer to the bottom of the text being edited. This would be used when quick access to the end of the edited text is required. C This option would be selected when a mistake or correction is required in a piece of text. You may correct one or any number of characters on the present line. If you wish to delete a character or number of characters on the line, you would select the characters for deletion and change then to a void input. Void input is an input containing no characters created by pressing return key alone. D Delete the present line of text and move the line pointer to the next line and print that line. E Exit from editor program ie used when you have finished your editing job. F One of the limitations of this editor is that you cannot go back a line therfore the FRONT command has been introduced to allow you to insert a line a line of text in front of the present line. Note this action does not disturb the present line. H This command is used in conjunction with the M command by inserting all information held in the move file below the present line. Note H stands for insert HERE. I This command allows you to insert a new line of text below the present line. Commands PAGE 204 COMMAND ACTION L This command allows you to locate a character or group of characters in any line following the present line. If the location is succesful then the line the characters have been found on becomes the present line. M This option allows you to move lines of text to other locations within your file being edited. Note the move file may contain any number of lines and they are held in the order they are entered. Please note that the H command does not remove one line at a time but all lines that have been put in the move file. N Move line pointer to the next line. This option may also be performed by pressing the return key without any characters being typed. Note the new line will be print on the VDU when this operation has been performed. P This command allows you see what is on the present line by printing then present line. R This command allows you to replace the present line with the text you will be requested to type in. S This command allows you show the whole contents of the file/section you are editing. When this operation is complete the line pointer will be at the start of the file/section. T This command allow you to reposition the line pointer back to the start of the file/section being edited. ie back to TOP of the buffer. U This command allows you insert a number of line of text into a file/section, you can contine inserting line of text UNTIL the return key is pressed alone CHAPTER 22 Utility program Tidy and Document program. INDEX 1 General information. PAGE 206 2 FACILITIES OF THE TIDY LAYOUT PROGRAM PAGE 208 3 SINGLE EXPANSIONS PAGE 210 4 MULTIPLE EXPANSIONS PAGE 211 5 Document program general information. PAGE 212 6 Facilities of document program. PAGE 213 7 common information to both TIDY and DOCUMENT programs PAGE 214 General information. PAGE 206 GENERAL INFORMATION ON EXPAND AND TIDY LAYOUT AND DOCUMENT PROGRAMS ------------------------------------------------------------------- ACTION REQUIRED TO USE THIS PACKAGE. ENTER AFTER PDS> THE FOLLOWING INFORMATION AS SO :- PDS> TDY --- Now we have the option of selecting the tdy program or document program, when the following message is output. WHICH PROGRAM DO YOU WISH TO RUN OPTIONS AVAILABLE 'EXPAND AND TIDY' OR 'DOCUMENT' PLEASE REPLY TDY/DOC ? 'If you reply TDY continue as below' 'Otherwise follow DOC instructions' INDENTS AFTER BEGINS YES/NO ? (This message allows you to specify where the (text after will start ie. 'BEGIN' ( TEXT DATA (is an example of indents after begins (if the answer was no to this question then the (output would be 'BEGIN' ( TEXT DATA etc. IS A DOCUMENTATION COPY TO LINEPRINTER WANTED YES/NO ? (If reply is YES then a copy of program is sent (lineprinter with each line numbered EXPANSIONS YES/NO ? (The reply to this question determines if (the expansions are to be used MONITOR YES/NO ? (This facility allows the user to monitor the (progress of program and will assist if any error (reports are generated. General information. PAGE 207 INPUT FILE ? OUTPUT FILE ? (Default options for input and output is your (own UIC and .COR. ie. an input of TDY is assumed (to be TDY.COR. If the monitor is not being used (the next message output will be PLEASE WAIT (At end of program the following message will (be output DO YOU WISH TO RERUN PROGRAM PLEASE REPLY YES/NO ? (If the reply is YES the program will restart (if the reply is SAME the program will restart (at message 'INPUT FILE' (If the reply is NO the program will output the (following message and return you to PDS> GOODBYE FACILITIES OF THE TIDY LAYOUT PROGRAM PAGE 208 FACILITIES OF THE EXPAND TIDY AND LAYOUT PROGRAM (1) The program will layout coral source code/s. procedures will be preceded by two newlines, comments will be preceded by one newline Begins and ends will be aligned and will be indented across the page as they are nested within the program and will be started on a newline. If there is an excess of BEGINS or ENDS an error message will be generated to inform the user. (2) Special action words 'CHANGE' will cause the program to request a new output file for the output coral code to be sent to 'IGNORE' will cause the program to stop transferring coral code to the output file 'RESTART'will cause the program to resume transferring the coral code to the output file (3) Expansion facility When the expansion facility is required an abreviated form of CORAL(66) may be presented to this program which will be then expanded into a coral source code suitable for the PDP11/70 coral compiler. (4) General information The program will always remove any ASCII character with a code value of less than 32 ie. non printing characters hence hopefully reducing compiling errors (5) The following language words are checked for validity AND ABSOLUTE ANSWER ARRAY BEGIN BITS BYTE CODE COMMENT COMMON CORAL DEFINE DELETE DIFFER DO DOUBLE END ELSE EXTERNAL ENTER FIXED FINISH FLOATING FOR GOTO IF INCLUDE INTEGER LABEL LIBRARY LIST LITERAL LOCATION NOLIST OCTAL OVERLAY OR MASK PRESET PROCEDURE RECURSIVE RAD50 STEP SEGMENT SWITCH TABLE TEST THEN UNION UNSIGNED UNTIL WHILE WITH FACILITIES OF THE TIDY LAYOUT PROGRAM PAGE 209 (6) Error reporting system If the program suspects that a language word is in error the program allows the option of changing the source text directly from the keyboard and inserting the new data in the output file. Note this is a very limited checking procedure and therefore it is possible for genuine error to bypass this error checking section Other checks that are performed are a count of all () [] brackets ensuring that they all match up. There is also a count of 'GOTO' statements though this is for the users benefit only. Other checks performed are :- Matching of 'FOR' 'DO' language words Matching of 'OVERLAY''WITH' language words. Matching of 'IF' 'THEN' language words. Matching of 'BEGIN' 'END' language words. and syntax of 'LITERAL' CONSTANTS. If this program suspects it has found a error you will be given the option to destroy the output file this sometimes can avoid you getting into a mess with version numbers. Note: If the batch command option is selected and errors found the output file is deleted automatically as you may have decided to run this program without wishing to watch the display. (7) Highlight mode Should you wish to identify special characters or groups of characters eg. TIDEF TNEW etc. When processing your program/s if you have selected the documentation copy option you will be allowed to select the highlight mode. If you select the highlight mode every time the program detects a occurrence of your identify character/s these character/s will be underlined on the documentation copy which is sent to the lineprinter. If you have selected to use highlights the message identify > will come on your terminal. You can select to a maximum of 5 character groups of maximum 50 characters to identify. Note: If you required only two character groups to identify the remaining three identify groups would be terminated by pressing the return key these would then become void fields. (8) Command batch controller If you have many programs which require tidying up then when the message INPUT FILE? appears you can submit a command file by preceding the command file name with an @ character. Note: When the @ character is detected the command file default option is assumed ie. .CMD and your own UIC See Topic for special file control characters. Note: Filenames read by the command controller are assumed to be your own UIC and .cor as this program is only suitable for coral programs. SINGLE EXPANSIONS PAGE 210 SINGLE EXPANSIONS DATA GROUP 'A' CONVERTS TO 'AND' 'ABS' CONVERTS TO 'ABSOLUTE' 'ANS' CONVERTS TO 'ANSWER' 'AR' CONVERTS TO 'ARRAY' 'B' CONVERTS TO 'BEGIN' 'BY' CONVERTS TO 'BYTE' 'BEG' CONVERTS TO 'BEGIN' 'COM' CONVERTS TO 'COMMENT' 'CMN' CONVERTS TO 'COMMON' 'COR' CONVERTS TO 'CORAL' 'D' CONVERTS TO 'DO' 'DEF' CONVERTS TO 'DEFINE' 'DEL' CONVERTS TO 'DELETE' 'E' CONVERTS TO 'END' 'EL' CONVERTS TO 'ELSE' 'EX' CONVERTS TO 'EXTERNAL' 'ENT' CONVERTS TO 'ENTER' 'F' CONVERTS TO 'FOR' 'FIN' CONVERTS TO 'FINISH' 'FLO' CONVERTS TO 'FLOATING' 'G' CONVERTS TO 'GOTO' 'I' CONVERTS TO 'INTEGER' 'INC' CONVERTS TO 'INCLUDE' 'L' CONVERTS TO 'LONG' 'INT' CONVERTS TO 'INTEGER' 'LAB' CONVERTS TO 'LABEL' 'LIB' CONVERTS TO 'LIBRARY' 'LIT' CONVERTS TO 'LITERAL' 'LOC' CONVERTS TO 'LOCATION' 'O' CONVERTS TO 'OCTAL' 'OVR' CONVERTS TO 'OVERLAY' 'M' CONVERTS TO 'MASK' 'P' CONVERTS TO 'PROCEDURE' 'PR' CONVERTS TO 'PRESET' 'PROC' CONVERTS TO 'PROCEDURE' 'REC' CONVERTS TO 'RECURSIVE' 'S' CONVERTS TO 'STEP' 'SEG' CONVERTS TO 'SEGMENT' 'SW' CONVERTS TO 'SWITCH' 'T' CONVERTS TO 'THEN' 'TE' CONVERTS TO 'TEST' 'TAB' CONVERTS TO 'TABLE' 'VAL' CONVERTS TO 'VALUE' 'U' CONVERTS TO 'UNTIL' 'W' CONVERTS TO 'WITH' 'WI' CONVERTS TO 'WHILE' MULTIPLE EXPANSIONS PAGE 211 MULTIPLE EXPANSION DATA GROUP 'BA' CONVERTS TO 'BYTE''ARRAY' 'DA' CONVERTS TO 'DOUBLE''ARRAY' 'FA' CONVERTS TO 'FLOATING''ARRAY' 'LA' CONVERTS TO 'LONG''ARRAY' 'IA' CONVERTS TO 'INTEGER''ARRAY' 'LB' CONVERTS TO 'LOCATION''BYTE' 'LD' CONVERTS TO 'LOCATION''DOUBLE' 'LF' CONVERTS TO 'LOCATION''FLOATING' 'LI' CONVERTS TO 'LOCATION''INTEGER' 'LL' CONVERTS TO 'LOCATION''LONG' 'VB' CONVERTS TO 'VALUE''BYTE' 'VD' CONVERTS TO 'VALUE''DOUBLE' 'VF' CONVERTS TO 'VALUE''FLOATING' 'VL' CONVERTS TO 'VALUE''LONG' 'VI' CONVERTS TO 'VALUE''INTEGER' 'BP' CONVERTS TO 'BYTE''PROCEDURE' 'DP' CONVERTS TO 'DOUBLE''PROCEDURE' 'FP' CONVERTS TO 'FLOATING''PROCEDURE' 'IP' CONVERTS TO 'INTEGER''PROCEDURE' 'LP' CONVERTS TO 'LONG''PROCEDURE' Document program general information. PAGE 212 GENERAL INFORMATION ON DOCUMENT PROGRAM --------------------------------------- DOCUMENTATION COPY PROGRAM -------------------------- DO YOU WISH TO USE IDENTIFY HIGHLIGHT MODE YES/NO ? (If you reply YES you may now select up to five (character strings which you wish to identify. After each (line is printed out, if the characters you have selected (occur in the line they will be underlined on the output (hard copy. SOURCE FILE ? (At this point you type in the name of the file (you wish to be presented to the lineprinter (the default options are (Your UIC and the extension .COR DO YOU WISH TO RERUN THIS PROGRAM PLEASE REPLY YES/NO ? (If you reply YES the program will restart (If you reply SAME program will restart (as message SOURCE FILE? (YES and NO reply may be shortened to Y or N (but for YES YE is not acceptable. (If your reply is NO or N the program returns (you back to PDS. Facilities of document program. PAGE 213 FACILITIES OF DOCUMENT PROGRAM (1) This program presents to the lineprinter a header which will tell you which file has been processed the time of day and the date and a note that the documentation program presented the data. (2) This program has the option of numbering each line of data as so:- EDITOR PAGE NUMBER LINE IN PAGE SEQUENTIAL LINE NUMBER COUNT If this option is not required precede the source filename with a minus eg. -DOC When this option is selected 8 spaces will precede each line of data. (3) When a number of files are required for printing you can present a batch command source to this program in the following manner:- SOURCE FILE? @MANYFILES.CMD The program will now scan through the file manyfiles.cmd processing Each file with a new header. Note: .CMD is assumed when first character is @ and your own UIC. structure of command file is:- (MINUS OPTION)(FILENAME .COR AND OWN UIC STILL ASSUMED IF MISSING) eg. -DOC.CMD DOC TDY -TDY.CMD Note: No terminator required on command file When all files processed program will check if any files to be processed. common information to both TIDY and DOCUMENT programs PAGE 214 COMMON INFORMATION ------------------- FILE CONTROL CODES. If a filename is preceded by a * character the file is assumed to be a void file and the file is not processed. If a filename is preceded by a - character the file is not modified but if lineprinter is selected it is copied out to lineprinter through the Document program without line numbering facility. If a filename is preceded by a # character if you are using the document program the # is ignored. If you are using the TDY program comments are left in the form you typed them in ie. # = don't format comments. CHAPTER 23 GENERAL INFORMATION AND REVISION LIST INDEX 1 GENERAL INFORMATION PAGE 216 2 REVISION LIST PAGE 217 GENERAL INFORMATION PAGE 216 CHARACTER STRINGS ----------------- STANDARD FORM OF PROCEDURE STRINGS BYTES 0,1 STRING BUFFER LENGTH BYTES 2,3 NUMBER OF CHARACTERS IN STRING BYTES 4,+ STORED CHARACTERS STRING ADDRESS RELATED TO BYTE [2] STANDARD FORM OF CORAL STRING BYTES 0,1 NUMBER OF CHARACTERS IN STRING BYTES 2,+ STORED CHARACTERS STRING ADDRESS RELATED TO BYTE [0] THE FOLLOWING PROCEDURE STRINGS ARE AVAILABLE FOR CORAL. STRING NAME MAX LENGTH AS 256 BS 256 UNTIL YS 256 ZS 256 BIGS 1996 INTEGER AND FLOATING REGISTERS FOR GENERAL USE ---------------------------------------------- THE MACRO (INTEGER REGISTERS) WILL DECLARE 26 INTEGERS NAMED A TO Z. THE MACRO (FLOATING REGISTERS) WILL DECLARE 26 FLOATING LOCATIONS NAMED FA TO FZ. AUTHORS ======= J. S. Clifton. R. J. Spriggs. 13th May 1982 3rd September 1981 Telephone Christchurch 472352 Telephone Christchurh 472208 REVISION LIST PAGE 217 Revision list ------------- Date Area Remarks ---- ---- ------- 22/10/81 R$POS R$COMPARE Enable upper/lower case matching 22/10/81 Cross reference Insertion of macro symbol reference table 13/12/81 Device control New section for device routines. 13/12/81 Table routines New section Tables similar to Nodes. 13/12/81 Queue routines New section Queue processing routines. 13/12/81 Macros Usage description appended. 22/04/82 String conversions More routines added 11/05/82 All Manual reformated for index program utility programs incorporated. 13/05/82 Supermac and Tabmac New Sections. 25/06/82 String macros New Sections. 27/10/82 Configuration macros Macros for setting configuration definitions and declarations. 05/11/82 Alone device macros Stand alone Device/terminal Handler. 05/11/82 Table Macros New section - Table accessing Macros. MASTER INDEX $$DEVT 30 $$END 108 131 $$EOFF 108 $$IOBF 30 $$LAB 108 $$MOFF 108 $$WOFF 108 $CALL 108 $EOFFS 108 $FCSR1 30 $LAB 108 $MOFFS 108 $RETUR 108 $RETURN statement. 136 $SET$K 108 $WOFFS 108 * 120 + 120 - 120 121 ...CM0 112 ...CM1 112 ...CM2 112 ...CM3 112 ...CM4 112 ...CM5 112 ...CM6 112 ..ACT 112 ..ARLE 112 ..BRAN 112 ..COND 112 ..CRLE 112 ..ERLE 112 ..GET 112 ..LB10 112 ..LB21 112 ..LB22 112 ..LB23 112 ..POP 112 ..PUSH 112 ..TAG 112 ..TEST 112 ..TPRM 112 ..V1.. 112 ..V2.. 112 .ARITH 109 .CDFN 109 .CHAIN 109 .CHCOP 109 .CLOSE 109 .CMKT 109 .CNTXS 109 .CRAW 109 .CRRG 109 .CSIGE 109 .CSISP 109 .CSTAT 109 .CTIMI 109 .DATE 109 .DELET 109 MASTER INDEX .DEVIC 109 .DRAST 109 .DRBEG 109 .DRBOT 109 .DRDEF 109 .DREND 109 .DRFIN 109 .DRSET 109 .DRVTB 109 .DSTAT 109 .ELAW 109 .ELRG 109 .EMIT 109 .EMITL 109 .EMITR 109 .ENTER 109 .EXIT 109 .FETCH 110 .FORK 110 .GENBR 110 .GMCX 110 .GOTO 110 .GTIM 110 .GTJB 110 .GTLIN 110 .GVAL 110 .HERR 110 .HRESE 110 .IFOPR 110 .INTEN 110 .IS 110 .LEAVE 110 .LOCK 110 .LOOKU 110 .MACS 110 .MAP 110 .MFPS 110 .MRKT 110 .MTATC 110 .MTDTC 110 .MTGET 110 .MTIN 110 .MTOUT 110 .MTPRN 110 .MTPS 110 .MTRCT 110 .MTSET 110 .MTSTA 110 .MWAIT 110 .OPADD 110 .OPSUB 110 .OR 110 .PRINT 111 .PROTE 111 .PURGE 111 .QELDF 111 .QSET 111 .RCTRL 111 .RCVD 111 MASTER INDEX .RCVDC 111 .RCVDW 111 .RDBBK 111 .RDBDF 111 .READ 111 .READC 111 .READW 111 .REGDE 111 .RELEA 111 .RENAM 111 .REOPE 111 .RSUM 111 .SAVES 111 .SCCA 111 .SDAT 111 .SDATC 111 .SDATW 111 .SDTTM 111 .SERR 111 .SETTO 111 .SFPA 111 .SIMPL 111 .SPCPS 111 .SPFUN 111 .SPND 112 .SRESE 112 .SYNCH 112 .TIMIO 112 .TLOCK 112 .TRPSE 112 .TTINR 112 .TTOUT 112 .TTYIN 112 .TTYOU 112 .TWAIT 112 .UNLOC 112 .UNMAP 112 .UNPRO 112 .WAIT 112 .WDBBK 112 .WDBDF 112 .WRITC 112 .WRITE 112 .WRITW 112 / 120 := 119 :== 119 :B= 119 :W= 119 A SPACE 26 A TAB 26 A. 104 154 A. actions [ rules 156 ACTION ENTRY. 145 ACTION STUB. 145 ACTIONS. 156 ADD 9 ADD TO 9 ADDCHR 104 MASTER INDEX ADDCHRSTRG [char],[src] 168 ADDSTR 104 ADDSTRING [src],[dest] 163 ADVANTAGES CLAIMED FOR. 149 ALLOCATED 23 ALONE 101 103 AND 104 AND statement. 123 ANDB 104 ANDB statement. 123 ARC 28 ARR 28 ASC 21 ASCR50 21 ASCRAD 21 ASK 14 ASSIGNMENT STATEMENT. 118 BAS 6 BASLIB 4 30 BASMAC 101 102 BEGIN 104 BEGIN statement. 132 BEGIN/END named block. 127 BIT OPERATORS. 119 BITDEF 104 BLK 27 BLOCKIN 25 BLOCKOUT 25 BRJ 104 BY 128 C BIT 180 C. 104 154 C. test [ rules 155 C.SHIFT 120 CAA DISCLAIMER. 142 CALL 150 CALL statement. 134 CALL$ statement. 134 CALLG 104 CALLG statement. 135 CARRY 120 CASE 104 CASE statement. 139 CASEB 104 CASEB statement. 139 CC 122 CCT 28 CD. 161 182 CD.CHR 161 182 CD.CHR (character) 59 CD.CNT 161 182 CD.CNT (count) 59 CD.DIC 59 CD.DST 161 182 CD.DST (destination) 59 CD.KEY 161 182 CD.KEY (table key) 59 CD.POS 161 182 CD.POS (position) 59 MASTER INDEX CD.RES 161 182 CD.RES (result) 59 CD.SRC 161 182 CD.SRC (source) 59 CHARACTER parameter 161 182 CHARVER 11 CHR 26 CIR 27 CLEAR 9 103 CLK 26 CLOCK 14 CLRSTR 104 CLRSTRING [label] 163 CMPSTR 104 CMPSTRING [src],[dest] 164 CNTC 103 CNTD 103 CNTZ 103 COM 121 COMMON DICTIONARY 161 182 COMMON DICTIONARY. 59 COMPARE 7 8 COMSORT 8 CONDITION CHECKS. 151 CONDITION ENTRY. 145 CONDITION STUB. 145 CONDITIONAL statements. 122 CONDITIONS. 155 CONFIG 4 101 104 CONT 89 175 176 COPY 7 25 CORAL 66 30 CORAL FLOATING REGISTERS 216 CORAL INTEGERS 216 CORAL MACROS 216 CORAL STRINGS 216 COUNT parameter 161 182 CR 103 CRLF 26 CRS 28 CS 122 CVT 22 CYPHER 12 DAT 26 DEBUG 104 178 DEBUGGING FACILITIES 159 DECISION TABLE ELEMENTS. 145 DECISION TABLE EXAMPLE. 158 DECISION TABLE FORMATS. 154 DECISION TABLE THEORY. 144 DEFS 101 DELCHR 104 DELCHRSTRG [pos],[src] 169 DESTINATION parameter 161 182 DETAB 104 151 DETAB name,global/local 154 DETAB INTERPRETATION. 151 DETEND 104 153 154 DETEND. 156 MASTER INDEX DEV 28 DEVICE 24 DEVICE LABELS 92 DEVIO 91 102 104 DIRECT COMPILER. 148 DMPBIT 104 179 DMPOFF 104 179 DMPSYM 104 179 DO 104 DOWNTO 104 128 DSW 30 85 89 DTBMAC 101 102 DTOR 28 DUMP 104 178 Delimiter '[' 155 156 E(rror) 155 ELSE 104 150 153 ELSE rule. 152 ELSE statement. 124 END 104 128 END statement. 123 130 132 ENTRYBLOCK 81 ENTRYP 104 ENTRYPOINT statement. 140 EOF 25 25 25 25 EOT 103 EQ 122 ERASE 103 ERR 25 25 25 25 ERROR 7 9 9 9 23 24 25 25 ERROR 25 25 25 25 125 136 ERROR MESSAGES, SUPMAC. 141 ESC 103 ETX 103 EXIT 104 150 180 EXIT T/F/S/E 180 EXITER 104 EXITERROR 180 EXITFA 104 EXITING (detabs). 156 EXITSU 104 EXITSUCCESS 180 EXITTR 104 EXPLICIT ELSE 154 EXTENDED ENTRIES. 157 EXTENDED ENTRY. 146 F$DIAG 50 F$FDB 49 49 49 50 50 50 50 F$GETR 49 F$LUN 50 F$NAME 49 F$OPEN 50 F$PUTR 49 F$SETUP 50 F$SHUT 49 F$SWITCH 50 F$TYPE 50 F(alse) 155 FACILITIES AND USES. 150 MASTER INDEX FF 103 FI 104 FILE 23 24 FILEFU 104 FILEIN 25 25 FILENAME 24 FILEOUT 25 FILL 9 FIRST 89 175 176 FLODEF 104 FLOW DIAGRAM. 144 FNAMDE 104 FOR 104 128 FOR.AB 104 FORTRAN LIBRARY CALLS. 135 FORTRAN PARAMETER BLOCK 135 FREE 23 GE 122 GENDEF 4 6 GENERAL ACTIONS. 154 GENMAC 105 GOTO 105 147 147 156 GOTO statement. 122 122 126 127 GT 122 HI 122 HIS 122 HT 103 IAS 4 101 103 IF 105 150 IF AND statement. 123 IF ANDB statement. 123 IF ELSE END. 123 IF OR statement. 123 IF ORB statement. 123 IF RESULT IS .. statement 125 IF block statement. 123 IF statement (nesting). 124 IF statement. 122 IFB 105 IFB statement 122 IFERRO 105 IFERROR 180 IFFALS 105 IFSSUCCESS 180 IFSUCC 105 IFTRUE 105 IGNORE RULE. 153 IINPUT 30 32 IMPLICIT ELSE 154 IMPLIED ELSE. 153 INCOMPLETE DECISION TABLES. 153 INCREMENT 128 INITIA 105 INITIAL ACTIONS. 154 INITIALISE 174 INKEYS 17 INPUT 105 173 INPUTN 105 INPUTNE 173 MASTER INDEX INSCHR 105 INSCHRSTRG [char],[pos],[src] 168 INTERPRETATIVE PROCESSOR. 148 IOMACS 101 102 IPRINT 30 31 JUMPTO 105 JUMPTO statement. 139 KEYS 75 L$ADDC 60 L$ADDS 62 L$ADDTO 66 L$CLEAR 66 L$CMPC 62 L$COMPARE 65 L$DELC 61 L$DELETE 62 L$GETC 60 L$INSC 61 L$MODC 60 L$MOVC 62 L$PAD 67 L$POS2 63 L$POS3 63 L$POSC 61 L$REVERSE 64 L$SEG 66 L$SHL 65 L$SHLE 64 L$SHR 64 L$SHRE 64 L$WEDGE 63 L.ROTATE 120 L.SHIFT 120 L01 7 L02 7 L03 7 L03A 7 L04A 7 L05 8 L05A 8 L06 9 L07/A/B 15 16 L07C/E/B 19 L07D 17 L07G 16 L07I 17 L07S 17 L08 20 L09 21 L10 20 L11 25 L11A 25 L11B 25 L11C 25 L12 25 L12A 25 L13 26 L14 26 L15 23 24 MASTER INDEX L16 9 L17 26 L18 26 L19 9 L20 26 L21 9 L22 26 L22A 26 L23 14 26 L24 10 L25 21 L25A 21 L26 21 L26A 21 L27 18 L28 8 L29 11 L30 11 L31 22 L32 12 L33 12 L34 12 L35 13 L35A 13 L36 14 L37 9 L7A 53 LABEL parameter 161 182 LAST 89 175 176 LBLOCKIN 25 LE 122 LEAVE 105 LEAVE statement. 122 122 126 LEGAL BINARY OPERATORS. 120 LEN 7 LET 105 LET - bit operators. 119 LET examples. 121 LET statement warning. 118 LET statement. 118 LFILEIN 25 LIMIT 128 LIMITED ENTRY. 146 LIST 101 105 159 LIST FLAG 101 LISTING FACILITIES 159 LO 122 LOS 122 LPOS 8 LSEG 7 LSI03 101 103 LSI23 101 103 LT 122 M$CHECK 88 M$HUNT 88 M04 31 31 32 32 MAC.MLB 4 MAC.OLB 4 MACBAS 105 MASTER INDEX MACBIO 4 MACDTB 105 MACHINE 101 101 103 MACIO 105 MACRO 11 30 MACRO GROUP 101 MACRO LIBRARY TABLE 103 MACROS 101 MACSTG 105 MACSUP 105 MACTBL 105 MESSAG 105 MESSAGE 89 MF01 49 MF02 49 MF03 49 MF04 49 MF05 50 MF06 50 MF07 50 MF08 50 MFUNCT 105 MG0 4 MG01 51 MG02 53 MG03 53 MG04 53 MG06 51 MG07 51 MG08 54 54 54 54 55 55 MG09 56 MG10 56 MG11 57 MG12 57 MG13 51 MGD03 (CD.DIC) 59 MI 122 MIXED ENTRY. 147 ML04 62 ML05 63 63 ML06 63 ML07 64 ML08 64 ML09 64 ML10 64 65 ML11 65 ML12 66 ML13 66 ML14 66 ML16 67 MLC01 60 MLC02 60 MLC03 60 MLC04 61 MLC05 61 MLC06 61 MLC07 62 MLC09 62 MLC12 62 MASTER INDEX MMC01 88 MMC02 88 MMT01 85 MMT02 85 MMT03 85 MMT04 85 MMT05 86 MMT06 86 MMT07 86 MMT08 86 MMT09 86 MMTD0 84 84 84 84 84 MN01 70 MN02 70 76 MN03 70 MN04 71 MN05 72 72 72 72 MN06 71 MN07 72 MN08 71 71 MN09 70 MN10 71 MODCHR 105 MODCHRSTRG [char],[pos],[src] 168 MOV 27 MOVSTR 105 MOVSTRING [src],[dest] 163 MOVTEX 106 MOVTEXT 176 MR01 40 MR02 40 40 40 MR03 40 41 41 41 41 MR04 36 MR05 34 34 34 MR06 37 MR07 36 MR08 38 MR09 38 MR10 38 38 MR11 35 MR12 36 MR13 36 MR14 37 MR15 43 MR16 37 MR17 43 MR18 43 MR19 39 MR20 39 39 MR21 42 MR23 52 MR24 52 MR25 52 MRC01 46 MRC02 46 MRC03 44 MRC04 46 MRC05 45 MRC06 47 47 MASTER INDEX MRC07 47 MRC08 45 48 MRC09 44 MRC10 46 MRC11 48 MRC12 44 MT$BACK 86 MT$DSW 84 MT$EFN 84 MT$EXIT 85 MT$FIND 86 MT$GET 85 MT$ISB 84 MT$LUN 84 MT$MARK 86 MT$OPEN 86 MT$PUT 85 MT$REWIND 86 MT$SHUT 85 MT$UNIT 84 MT01 76 MT03 76 MT04 78 MT05 79 79 79 79 MT06 77 77 MT07 80 80 MT08 78 78 MT09 77 77 77 MT10 78 78 MT11 80 MULS 11 MX01 175 177 MX02 89 89 MX04 175 MX06 180 MX07 174 MX08 171 172 MX09 178 MX10 173 MX11 178 MX12 179 N$CREATE 70 N$DELETE 71 N$DIAG 70 N$DUMP 70 N$FIRST 72 N$INIT 70 72 N$LAST 72 N$NEXT 72 N$PRESENT 72 N$PROTECT 71 N$SEEK 71 N$SETUP 72 N$SQUEEZE 71 N$UNPROTECT 71 N(o) 155 NAND 119 120 NCC 106 NCS 106 MASTER INDEX NE 122 NEG 121 NEQ 106 NESTING TABLES. 147 NEWFRM 28 NEWLIN 106 NEWLINE 178 NGE 106 NGT 106 NHI 106 NHIS 106 NLE 106 NLO 106 NLOS 106 NLT 106 NMI 106 NNE 106 NODE 106 NODEBL 106 NODEBLOCK 73 NODEFS 101 NOERROR 136 NOLIST 101 106 159 NOMACS 101 NOT 121 NOTRAC 106 NOTRACE 101 159 NPL 106 NULL 103 NULSTG 186 NVC 106 NVS 106 OFF 103 OFF.BY 119 120 ON 103 ON.ERR 106 ON.ERROR 125 ON.NOE 106 ON.NOERROR 125 OP.SYS 101 OPEN 84 OPEN AND CLOSED TABLES. 147 OPSYS 103 OR 106 119 OR inclusive. 120 OR statement. 123 ORB 106 ORB statement. 123 P.D 106 P01 27 P02 27 P03 27 P04 27 P05 27 P06 27 P07 27 P08 28 P09 28 P10 28 MASTER INDEX P11 28 P12 28 P13 28 P14 28 P16 28 28 PAD 106 PAD [lab],[char],[cnt] 162 PARITY 103 PDP70 101 103 PL 122 PLS 28 PLT 27 POP 106 120 POP statement. 137 POPB 106 POPB statement. 137 POPCHR 106 POPCHRSTRG [src] 169 POS 8 POSITION parameter 161 182 PRE-PROCESSOR. 148 PRESET 106 177 PRINT 106 171 PRINTA 106 171 PRINTB 106 172 PRINTC 106 171 PRINTD 106 172 PRINTH 106 172 PRINTO 106 172 PRINTR 106 172 PROBE 106 PROBE statement. 140 PROBEB 106 PROBEB statement. 140 PROCED 106 PROCEDURE statement. 140 PSECT 30 PTEXT 106 172 PUSH 106 120 PUSH statement. 138 PUSHB 106 PUSHB statement. 138 PUSHCH 106 PUSHCHRSTRG [char],[src] 169 QUEBUF 106 176 QUOTE 26 R$ADDC 44 R$ADDRESS 51 R$ADDS 44 R$ADDTO 36 R$BASC 43 R$BBIN 40 R$BDEC 40 R$BHEX 40 R$BINB 40 R$BITPOS 51 R$BITSET 51 R$BOCT 40 R$BR50 43 MASTER INDEX R$CLEAR 36 R$CLK 39 R$CMPC 44 R$COMPARE 35 217 R$CR50 45 R$DAT 39 R$DECB 41 R$DELC 45 R$DELETE 36 R$GETC 46 R$HEXB 41 R$INSC 46 R$LCUC 46 R$MODC 46 R$MOVC 47 R$NTDY 42 R$OCTB 41 R$PAD 37 R$PARITY 51 R$POS 34 34 217 R$POS2 34 R$POSC 47 R$POSS 47 R$QADD 52 R$QREM 52 R$QTST 52 R$R50C 48 R$R50L 43 R$REVERSE 36 R$SAVE 51 R$SEG 37 R$SHL 38 R$SHLE 38 R$SHR 38 R$SHRE 38 R$STRB 41 R$UCLC 48 R$UIC 39 R$UNSAVE 51 R$WEDGE 37 R.ROTATE 120 R.SHIFT 120 R50ASC 21 RADASC 21 RCC 107 RCS 107 RED 27 RELEVANCE TESTING. 152 REPCHA 107 REPCHAR 172 REPEAT 107 150 156 REPEAT statement. 129 130 REPORT 88 89 107 REQ 107 RESERV 107 RESERVE 175 RETURN 156 180 RETURN statement. 136 RGE 107 MASTER INDEX RGT 107 RHI 107 RHIS 107 RLE 107 RLO 107 RLOS 107 RLT 107 RMI 107 RNE 107 ROLSTR 107 ROLSTRING [src] 165 RORSTR 107 RORSTRING [src] 165 RPL 107 RSX 4 RT-11 4 RT04 19 RT11 101 103 RTH 27 RTMACS 101 102 RULE MASK TECHNIQUE. 151 RVC 107 RVS 107 S(uccess) 155 SAME 7 SAVE 107 175 SEG 7 SEQUENCED TABLE ACCESS. 186 SERIO 97 102 107 SET 103 SET SUCCESS 180 SET.BY 119 120 SETERR 107 SETERROR 180 SETFAL 107 SETREG 107 SETSUC 107 SETTRU 107 SHIFT 12 120 SHLSTR 107 SHLSTRING [src] 165 SHRSTR 107 SHRSTRING [src],[char] 166 SINPUT 30 32 SIZE 28 SMCALL 107 SOJ 107 SOURCE parameter 161 182 SPACE 103 SPACES 107 178 SPLIT 13 SPLITS 13 SPPAD 107 SPPAD [label] 162 SPRINT 30 31 SQR 28 SRP 12 STANDARD DEFINITIONS. 103 STANDARD DEFS 101 MASTER INDEX STAT 136 STGMAC 102 STGMACS 101 STR 20 STRING 107 175 STX 103 SUBSTR 107 SUBSTRING [src],[dest] 166 SUCCESS 7 9 9 9 11 23 24 25 SUCCESS 25 125 SUPER-MAC. 117 SUPERMAC. 150 SUPMAC 101 102 107 SWABST 107 SWABSTRING [src] 167 SYS 17 SYSTEM CONFIGURATION 101 Standard Definitions. 103 T$CREATE 77 77 77 T$DELETE 77 77 T$DIAG 76 T$DKEY 77 T$DUMP 76 T$FIRST 79 T$IKEY 77 T$INIT 76 79 T$LAST 79 T$NEXT 80 T$PRESENT 79 T$PREVIOUS 80 T$PROTECT 78 T$RSEQ 80 T$SCHK 77 T$SEEK 78 T$SETUP 79 T$SORT 78 T$SQUEEZE 78 T$UNPROTECT 78 T(rue) 155 T..ALL 108 TAB 103 TABDEF 108 TABLE 108 TABLE [bytes] 81 TABLEB 108 TABLEBLOCK 81 183 TABLEBLOCK (Example) 183 TABLEBLOCK (size) 183 TABLOAD 10 TABMAC 108 TABMOD 9 TBLMAC 101 102 TCLOSE 108 186 TCREAT 108 TCREATE 185 TERMIN 108 TERMINAL 18 TERMINATE 174 TEST statement form. 122 MASTER INDEX THE DASH RULE. 147 THEN 108 150 THEN statement. 122 122 127 THRU 108 THRU statement. 130 TI0: 53 TIDEF 30 TINSER 108 TINSERT 186 TKILL 108 184 TLOOKU 108 TLOOKUP 184 TO 108 128 TOP 120 137 139 TPROTE 108 TPROTECT 185 TRACE 101 108 159 TRACE FLAG 101 TRACING FACILITIES 159 TREAD 108 184 TREMOV 108 TREMOVE 186 TSTSTR 108 TSTSTRING [src] 167 TUNPRO 108 TUNPROTECT 185 TWRITE 108 184 TXT 27 UIC 24 26 UNARY OPERATORS. 121 UNSAVE 108 175 UNTIL 108 UNTIL statement. 129 130 UNTILB 108 UNTILB statement. 129 130 V$CHANNEL 54 55 V$DDEV 55 V$DEVICE 55 V$DUNT 54 55 V$INPUT 53 V$IO 53 V$LUN 53 54 V$OFF 54 V$ON 54 V$SWITCH 55 V$TERMINAL 54 V$TX 53 56 56 57 V$TXA 56 V$TXB 56 172 V$TXC 57 172 V$TXD 57 VAL 20 VC 122 VDU 15 16 53 54 VDULUN 16 VDUSP 17 VS 122 WHILE 108 WHILE statement. 127 131 MASTER INDEX WHILEB 108 WHILEB statement. 131 XOR 120 Y(es) 155 ZPAD 108