Digital PDFs
Documents
Guest
Register
Log In
DEC-08-ARXB-D
March 1970
108 pages
Original
3.1MB
view
download
Document:
8K SABR Assembler 197003
Order Number:
DEC-08-ARXB-D
Revision:
Pages:
108
Original Filename:
http://bitsavers.org/pdf/dec/pdp8/fortran/DEC-08-ARXB-D_8K_SABR_Assembler_197003.pdf
OCR Text
Digital Equipment Corporation Maynard, Massachusetts PDP-8 Family Programmer's Reference Manual BK SABR ASSEMBLER DEC-08-ARXB-D PDP-8 BK SABR ASSEMBLER PROGRAMMER'S REFERENCE MANUAL For additional copies of this document, order No. DEC-08-ARXB-D from Program Library, Digital Equipment Corporation, Maynard, N"oss. 01754 Price $2 .00 DIGITAL EQUIPMENT CORPORATION o MAYNARD, MASSACHUSETTS 1st Printing Apri I 1969 2nd Printing (Rev) March 1970 Your attention is invited to the last two pages of this manual. The Reader 1s Comments page, when filled in and returned, is beneficial to both you and DEC. All comments received are considered when documenting subsequent manuals, and when assistance is required, a knowledgeable DEC representative wi 11 contact you. The Software Information page offers you a means of keeping up-to-date with DEC's software. Copyright© 1969, 1970 by Digital Equipment Corporation Documents Referenced {avai Iable from DEC's Program Library): Introduction to Programming, C-18 8K FORTRAN Programmer's Reference Manual, DEC-08-KFXB-D Paper Tape System User's Guide, DEC-08-NGCC-D PDP-8/I Disk Monitor System, DEC-08-SDAB-D The following are trademarks of Digital Equipment Corporation, Maynard, Massachusetts: PDP FLIP CHIP DIGITAL DEC FOCAL COMPUTER LAB ii CONTENTS Page CHAPTER 1 THE SABR LANGUAGE 1.1 Introduction 1-1 1.2 The Character Set 1-2 1.3 Statements 1-2 l .3. l Labels 1-3 1 .3 .2 Operators 1-3 1 .3 .3 Operands 1-4 1 .3 .4 Comments 1-4 1 .3 .5 Format Effectors 1-5 1.4 1-6 Symbols 1 .4. 1 Permanent Symbo Is 1-6 1 .4.2 User-Defined Symbo Is 1-6 1 .4.3 Equivalent Symbols 1-6 1 .4.4 Incrementing Operands 1-7 1 .4.5 The Symbol Table Listing 1-8 1.5 1-8 Constants l .5. l Numeric Constants 1-9 l .5 .2 ASCII Constants 1-9 1.6 1-9 Litera Is CHAPTER 2 PSEUDO-OPERATORS 2. l Assembly Control 2-1 2.2 Symbol Definition 2-4 2.3 Data Generating 2-5 2.4 Externa I Subroutine 2-7 2 .4.1 The CALL and ARG Statements 2-8 2.4.2 The ENTRY and DUMMY Statements 2-9 2 .4.3 The RETRN Statement 2-10 2.4.4 Picking up Subprogram Arguments 2-10 iii CONTENTS (Cont) Page CHAPTER 3 THE ASSEMBLED BINARY CODE 3 .1 The Binary Output Tape 3-1 3.2 The Loader Relocation Codes 3-1 3.3 Page Assembly 3-3 3 .3.1 Page Format 3-4 3.3.2 Page Escapes 3-4 3.3.3 Multiple Word Instructions 3-5 3.3.4 Run-Time Linkage Routines 3-5 3.3.5 Skip Instructions 3-7 3.4 Program Addresses 3-8 3.5 The Symbol Table 3-8 CHAPTER 4 SABR OPERATING PROCEDURES 4.1 Loading SABR in a Basic PDP-8 System 4-1 4.2 Loading SABR in a Disk Monitor System 4-1 4.3 Operating SABR 4-2 4.4 Operating Procedure for use as FORTRAN Pass 2 4-3 4.4.1 Method 1 4-4 4.4.2 Method 2 4-4 4.4.3 Method 3 4-5 CHAPTER 5 THE LINKING LOADER 5 .1 Introduction 5-1 5.2 Loading with the Linking Loader 5-1 5.3 Loading Information Options 5-2 5.4 How to Load the Linking Loader 5-3 5.5 Operation of the Linking Loader 5-3 iv CONTENTS (Cont) CHAPTER 6 DEMONSTRATION PROGRAM APPENDIX A ASCII CHARACTER SET APPENDIX B PERMANENT SYMBOL TABLE APPENDIX C ERROR MESSAGES APPENDIX D FREE PAGE 0 LOCATIONS APPENDIX E THE LIBRARY SUBPROGRAMS APPENDIX F SAMPLE OF AN ASSEMBLY LISTING APPENDIX G OPERATING PROCEDURES APPENDIX H DISK LINKING LOADER v PREFACE This manual contains a detailed description of the 8K SABR Symbolic Assembly System. The SABR (Symbolic Assembler for Binary Relocatable programs) programming language is similar to that of PAL III with many additional features. It is an advanced one-pass assembler for use with a PD P-8/I, -8/L, -8, -8/S, or -5 computer with at least 8K (up to 32K) words of core memory and an ASR-33 Teletype; a high-speed photoelectric paper tape reader and punch is not required, although it is highly recommended. DEC offers four symbolic assemblers for use on PDP-8 family computers: as follows: a. PAL III Symbolic Assembler, the basic 4K assembly system. It is a twopass assembler with an optional third pass which produces an octal/symbolic assembly program listing, and is highly recommended for the computer with 4K words of core memory. It is an excel lent assembly language for the less experienced programmer yet powerfu I enough to satisfy the needs of the advanced programmer. b. MACR0-8 Symbolic Assembler, essentially PAL III with the following additional features: user-defined macros, double precision integers, floatingpoint constants, arithmetic and Boolean operators, literals, text facilities, and automatic off-page I inkage generation. It is recommended for the computer with 4K words of core memory when any of the additional features listed above are desired. c. PAL-D Symbolic Assembler, essentially MACR0-8 excluding macros. It is used only in the PDP-8/I Disk Monitor System and requires 4K words of core memory. d; 8K SABR Symbolic Assembler; primarily for experienced programmers to use with a computer that has 8K to 32K words of core memory. It differs from the preceding assemblers in its operating procedures, character set, pseudo-ops, execution of the assembled program, and especially in its assembled output (relocatable binary code). It is assumed that the reader is familiar with assembly language programming. For an elementary approach to this type of programming, we recommend D'EC's publication, Introduction To Programming (specify Order No. C-18), avai Iable from the Program Library (address on Title page). vii CHAPTER l THE SABR LANGUAGE 1. 1 INTRODUCTiON SABR (Symbolic Assembler for Binary Reiocatable programs) is an advanced one-pass symbolic assembler. It translates symbolic programs written in the SABR language into binary relocatable code acceptable to the computer. SABR programs are core page independent. Therefore, programs may be written without regard to the 128-word core page of the computer. SABR automatically generates off- page and off-field references for direct or indirect statements. It also automatica i iy connects instructions on one page to those that overflow onto the next. The list of available pseudo-ops is extensive, including external subroutine calling, argument passing, and conditional assembly. SABR offers an optional second pass to produce a side-by-side octal/symbolic listing of the assembled program. The relocatable binary tapes produced by SABR are loaded into any field of core memory using the 8K Linking Loader, as are the I ibrary of subprograms. These subprograms may be cal led by any SABR program. In addition to being a stand-alone symboiic assembler, SABR aiso acts as the second pass of the 8K FORTRAN cbmpi ler (see 8K FORTRAN Programmer's Reference Manual, DEC-08-KFXB-D). SABR requires a PDP-8/1 1 -8/L / -8 1 -8/S, or -5* computer with at !east 8K words of core memory and an ASR-33 Teletype. A high-speed photoelectric paper tape reader and punch is not necessary, although it is highly recommended. The assembler system is furnished on four appropriately identified paper tapes. The SABR Assembler and 8K Linking Loader tapes are punched in binary coded format and are loaded into core memory using the Binary Loader (see PDP-8/I System User's Guide, DEC-08-NGCB-D). The two library of subprograms tapes are punched in relocatable binary coded format and are loaded into core memory using the BK Linking Loader as explained in this manual. With the exception of a few minor differences (and an entirely different list of pseudo-ops), the symbolic programming language for SABR is similar tothe PAL III language. However, the binary output from SABR is in relocatable binary code and is quite different from the PAL III binary output. The rest of this chapter describes the SABR language in full. For a more elementary approach to assem- bly language programming, we recommend DEC's new Introduction To Programming (specify Order No. C-18), available from the Program Library (address on Title page). *The PDP-5 computer requires a PDP-8 extended memory control modification. 1-1 l. 2 THE CHARACTER SET a. Alphabetic: Besides the normal alphabetic characters A, B, C, ... , X, Y, Z, the following characters are considered to be alphabetic by SABR: [ ] \ b. Ieft bracket, right bracket, back slash, up arrow. Numeric: 0, 1, 2, ... , 8, 9 c. Special: I II .JI. TT Comma delimits a symbolic address label Slash indicates start of a comment Left parenthesis indicates a literal (D indicates numeric literal is decimal; (K indicates numeric literal is octal Quote precedes an ASCII constant Minus sign negates a constant Number sign increases value of preceding symbol by one RETURN (carriage return) terminates a statement Semicolon terminates an instruction LINE FEED ignored FORM FEED ignored SPACE separates and delimits items on the statement line TAB same as space RUBOUT ignored All other characters are i Ilega I except when used as ASCII constants fo Ilowing a quote ( 11 ) , or in comments or text strings. Legal characters used in ways different from the above and all illegal characters cause the error message C (Illegal Character) to be printed by SABR. 1.3 STATEMENTS SABR symbolic programs are written as a sequence of statements, and are usually prepared on a teletype with the aid of the Symbolic Editor program. Each statement is written on a sing le Iine and is terminated by typing the RETURN key (carriage return/I ine feed sequence, abbreviated CR/LF). 1-2 SABR statements are virtually format free, because elements of a statement are not placed in numbered columns with rigidly controlled spacing between elements, as in punched-card oriented assemblers. A statement line is composed of one or all of the following elements: label, operator, operand, comment, and/or format effectors. The types of elements in a statement are identified by the order of appearance in the line and by the separating or delimiting character which follows or precedes the e Iement. Statements are written in the general form label, operator operand /comment SABR interprets and processes the statements, generating one or more machine (binary) instructions or data words during assembly. An input line may be up to 72 10 characters iong, including spaces and tabs. Any characters beyond this limit are ignored. l. 3. 1 Labels A label is a symbolic name or location tag created by the programmer to identify the address of a statement in the program. Subsequent references to the statement can be made merely by referenc- ing the label. If present, the label is written first in a statement and is terminated by a comma. Examples: 0200 0201 0000 1200 SAVE, ABC, 0 TAD SAVE Where SAVE and ABC are the labels, the statements are in location 0200 and 0201, and generate the instructions 0000 and 1200. 1.3.2 Operators An operator may be any one of the following items. a. A mnemonic memory reference instruction fol lowed by an operand. b. A mnemonic memory reference instruction fol lowed by an I fol lowed by an operand. This creates an indirect memory reference instruction. c. A single mnemonic microinstruction (operate or IOT instruction) or a string of such instructions separated by spaces or tabs. Combinations of microinstructions are formed by inclusive ORing the octal values of the instructions. Group l operate instructions can be combined with Group l instructions only, and Group 2 with Group 2 only, except for the CLA instruction which may be combined with either group. IOT instructions may not be combined with operate instructions. (Refer to Appendix B for a summary of all microinstructions.) 1-3 d. A pseudo-operator (Refer to Chapter 2, Pseudo-Operators) . Operators are terminated with a space or tab if an operand fol lows, otherwise they may be terminated with either a semicolon, slash, or carriage return. Examples: 0200 0201 0202 0203 1320 1550 7004 7620 TAD SAVE TAD I POINTR RAL SNL SMA CLA PAGE A 11 SAB R operators a re Ii sted in Appendix B. l .3 .3 Operands Operands may occur in three ways: a. Fol lowing a memory reference instruction, and separated from it by a space or tab; the operand is the address of the data to be accessed by the instruction. This address may be a user-defined address symbol or a numeric constant. If a symbol is used as the operand, it must be defined somewhere in the program. Constant addresses must be used with great care because the assembled program wi 11 be relocatable. If the memory reference instruction is indirect (fol lowed by I) the operand is the address of the address of the data to be accessed. An opeicmd fo!!o;ving c direct memory reference instruction may also be a literal. b. As the argument of a pseudo-operator. c. On a line with no operator. In this case, the operand is cal led a parameter. A parameter may be a numeric constant, a literal, or a user-defined address symbol. Examples: 0200 0201 0202 0203 0200 7460 0315 0176 ABC, 200;-320; M POINTR, 1000 1576 1375 START I PGOADR REORG TAD I TAD 1001 1.3.4 II 1000 POINTR (3 Comments A programmer may add notes to a statement fol lowing a slash mark. Such comments do not affect assembly processing or program execution, but they are useful in the program listing for later analysis and debugging. Entire Iines of comments may be present in the program. NOTE None of the special characters or symbols have significance when they appear in a comment. 1-4 Examples: /THIS IS A COMMENT LINE. /THIS TOO. TAD; CALL; # 11 -2 (+ = ! A A, i .3 .5 TAD SAVE /COMMENT Format Effectors Spaces and tabs are the formatting characters, usually used in the body of a symbolic pro- gram to provide a neat page. They can separate elements of a statement / as between an instruction and a comment. For example, the lines GO, TAD TOTAL/MAIN LOOP DCA I SAVE TAD BUFPTR SZA CLA/CHECK FOR END LOOP JMP GO are much easier to read when written as: GO, TAD DCA I TAD SZA CLA JMP TOTAL SAVE BUFPTR /MAIN LOOP /CHECK FOR END LOOP GO The RETURN key (CR/LF) is both a statement and a line terminator. The semicolon may be used to terminate an instruction without terminating a statement line. This allows the programmer to place several I ines of coding on a single line. If, for example, he wishes to write a sequence of instructions to rotate the contents of the accumulator (AC) and link (L) six places to the right, it might look like RTR RTR RTR But, with the semicolon, the programmer may place all three RTR's on a single line, separating each RTR with a semicolon and terminating the line with the RETURN key. The above sequence of instructions cou Id then be written RTR; RTR; RTR (terminated with the RETURN key) This format is particularly useful when creating a list of data. Example: 0200 0201 0202 0203 0020 0050 7750 0062 LIST I 20; 50; -30; 62 Null lines may also be used as format effectors. A null line is a line containing only a carriage return, and possibly spaces or tabs. Such lines appear in the listing simply as blank lines. 1-5 l .4 SYMBOLS Symbols are composed of legal alphanumeric characters. There are two major types of symbols, permanent symbols and user-defined symbols, and there are variations within each major type. A symbol is delimited by a nonalphanumeric character. 1.4.1 Permanent Symbo Is Permanent symbols are predefined and maintained in SABR's permanent symbol table. They include all of the basic instructions and pseudo-ops listed in Appendix B. These symbols may be used without prior definition by the user. The OPDEF and SKPDF pseudo-operators are used to define instruction operators not included in the permanent symbol table. l .4 .2 User-Defined Symbols A user-defined symbol is a string of from one to six legal alphanumeric characters delimited by a nonalphanumeric character. User-defined symbols are composed according to the following rules. a. The characters must be legal alphanumerics, which are: ABCD ... XYZ [ \J t and 0123456789. b. The first character must be alphabetic. c. The symbol should not contain more than six characters. Only the first six characters of any symbol are meaningful, the remainder, if any, are ignored. Therefore, a symbol such as INTEGER would be interpreted as INT EGE since the seventh character is ignored, and because the two symbols GEORG El and GEORGE2 differ only in the seventh character, they would be treated as the same symbol, GEORGE. d. A user-defined symbol cannot be the same as any of the predefined permanent symbols, and, e. A user-defined symbol must be defined only once. Subsequent definitions of the same symbol wil I be ignored and cause SABR to type the error message M (Multiple Definition). A symbol is defined by appearing as a symbolic address label (Refer to Section l .3. 1) or by appearing in an ABSYM, COMMN, OPDEF or SKPDF statement (Refer to Chapter 2, Pseudo-Operators). No more than 64 different user-defined symbois may occur on any one core page. 1 .4.3 Equivalent Symbols When an address label appears alone on a line, i.e., with no instruction or parameter, the iabel is assigned the value of the next address assembled. 1-6 Foi example, TAGl I TAG2, TAG3, 30 TAG 1 and TAG2 are equivalent in that they are assigned the same value. Therefore, a TAD TAG 1 will reference the data at TAG2. TAG3, however, is not equivalent to TAG2. TAG3 would be defined as 1 greater than TAG2. 1 .4.4 Incrementing Operands Because SABR is a one-pass assembler and also sometimes generates more than one machine instruction for a single user instruction, operand arithmetic is impossible; i.e., statements of the form TAD TAD JMP TAG+3 LISTl - LIST2 • +6 are i I legal. However, in one special case such references are possible. By appending a number sign (#)to an address operand, the user will reference a location exactly one (1) greater than the location of the address operand. Thus TAD Loe# is equivalent to the PAL language statement TAD LOe+ 1. Example: 0200 0201 0202 0203 0020 0030 1200 1201 0400 0401 0200 0201 LOe, START I A, B, 20 30 TAD TAD PAGE LOe Loe# LOe Loe# /GET 20 /GET 30 NOTE In assembling# - references, SABR does not attempt to determine if multiple machine code words are generated at the symbolic address referenced. ExampJe: START I /Loe IS OFF-PAGE /USER HOPES TO MODIFY TAD I NOP LOe TAD DeA (7500 /SMA START# 1-7 The user hopes to change the NOP instruction to an SMA. However, this is not possible because the TAD I LOC wi 11 be assembled as three machine code words; if ST ART is at 0200, the NOP will be at 0203. The SMA will be inserted at 0201, thus destroying the second word of the TAD I LOC execution. To avoid this error, the user should carefully examine the assembly listing before attempting to execute a program with # - references • In the previous example, the proper sequence is: START, VAR, TAD I NOP LOC TAD DCA (7500 VAR The # - sign feature is intended primarily for use in manipulating DUMMY variables, in picking up subroutine arguments in external subroutines, and returning from external subroutines. Refer to Section 2 .4 .4 for a fut I explanation of how this is done. 1.4.5 The Symbol Table Listing Symbols are listed in alphabetic order at the end of the assembly pass (Pass 1) with their relative addresses beside them. The fol lowing flags are added to special types of symbols. ABS COM OP EXT UNDF l .5 The address is absolute. The address is in COMMON. The symbol is an operator. The symbol is an external and may or may not be defined. If not defined, there is no difficulty; it is in another program. The symbol is not an external symbol and has not been defined in the program. This is a programmer error. No earlier diagnostic can be given because it is not known that the symbol is undefined unti I the end of Pass l . A location is reserved for the instruction containing the undefined symbol, but nothing is placed in it. CONSTANTS There are two types of constants: numeric and ASCII. These are discussed individually below. ASCII constants are used only as parameters. Numeric constants may be used as parameters or as operand addresses . Example: 0200 1412 12 TAD I 1-8 Constant operand addresses are treated as absolute addresses, just as a symbol defined by an ABSYM statement. References to them are not generally relocatable. Therefore, they should be used only with great care. The primar1 use of constant operand addresses is to ieference locations in page 0. (See Appendix D for a list of free locations in page 0 of each field.) All constant operand addresses are assumed to be in the field into which the program is loaded by the Linking Loader. Constants may not be added or subtracted to/from each other or to/from symbols. 1.5.1 Numeric Constants A numeric constant consists of a singie string of from one to four digits. It may be preceded by a minus sign(-) to negate the constant. The digit string will be interpreted as either octal or1decimal according to the latest permanent mode setting by an OCTAL or DECIM pseudo-op. Octal mode is assumed at the beginning of assembly. The digits 8 and 9 must not appear in an octal string. Examples: A, 0200 0201 5020 7575 5020 -203 0202 0120 80 DEC!M l .5 .2 ASCII Constants Eight-bit ASCII values may be created as constants by typing the ASCII character imme- diately following a double quotation mark ( 11 ) . A minus may be used to negate an alpha constant. The minus sign must precede the quotation mark. Examples: 0200 0201 0202 0273 7477 0207 A, _,.A II II I ' -301 I BELL FOLLOWS II The following characters are illegal as alpha constants: carriage return, line feed, form feed, rubout . l .6 LITERALS The use of I iterals is a special and convenient way of generating constant data in a program. Literals are normally used by TAD and AND instructions, as in the fol lowing examples: 1-9 0200 0201 0202 0376 1375 1374 0374 0375 0376 0303 7730 0777 A, AND TAD TAD (777 (-50 ("C A literal is always a numeric or ASCII constant and must be preceded by a left parenthesis. The value of the literal will be assembled in a table near the end of the core page on which the instruction referencing it is assembled. The instruction itself will be assembled as an appropriate reference to the location where the numeric value of the literal is assembled. Literals may not be referenced indirectly. The current numeric conversion mode can be changed on a purely local basis for a literal by inserting a D for decimal or a K for octal between the left parenthesis and the constant. Examples: (D32 becomes 0040 (octal) (K-32 becomes 7746 (octal) This usage does not alter the prevailing permanent conversion mode. A literal may also be used as a parameter (i.e., with no operator). In such a case the numeric value of the literal is assembled as usual in the literal table near the end of the core page currently being assembled, and a relocatable pointer to the address of the I iteral is assembled in the location where the literal parameter appeared. Example: 0200 0376 01 0376 0020 A, (20 This feature is intended primarily for use in passing external subroutine arguments with the ARG pseudo-op (see Section 2 .4. l). 1-10 CHAPTER 2 PSEUDO-OPERA TO RS 2 .1 ASSEMBLY CONTROL END Every program or subprogram to be assembled must contain the END pseudo-op as its last line. If this requirement is not met 1 an error message (E) is given. PAUSE The PAUSE pseudo-op causes assembly to halt. It is designed to allow the user to break up large source tapes into several smaller ones. To do this 1 the user need on iy pi ace a PAUSE statement at the end of each section of this source except the last. Then when assembly halts at a PAUSE 1 he may remove the source tape just read from the reader and insert the next one. Assembly may then be continued by pressing the console CO NTi nue switch. WARNING The PAUSE pseudo-op is designed specifically for use at the end of partia I tapes and should not be used otherwise. The reason for this is that the reader routine may have read data from the paper tape into its buffei that is actually beyond the PAUSE statement. Consequently 1 when CONTinue is pressed after the PAUSE is found by the line interpreting routine 1 the entire content of the reader buffer fol lowing the PAUSE is destroyed 1 and the next tape begins reading into a fresh buffer. Thus, if there is any meaningful data on the tape beyond the PAUSE statement 1 it wi II be lost. DEC IM Initially the numeric conversion mode is set for octal conversion. However 1 if the user wishes, he may change it to decimal by use of the DECIM pseudo-op. OCTAL If the numeric conversion mode has been set to decimal 1 it may be changed back to octal by use of the OCTAL pseudo-op. No matter which conversion mode has been permanently set, it may always be changed locally for literals by use of the (Dor (K syntax described earlier. Examples: 320 0200 0320 0201 0202 0203 0500 0377 01 1000 320 (K320 512 0204 0512 512 START I DEC IM OCTAL 2-1 0205 0206 0376 01 0320 (0512 320 END 0376 0377 1000 0320 LAP The assembler is initia I ly set for automatic generation of jumps to the next core page when the page being assembled fi I ls up (Page Escapes), or when PAGE or REORG pseudo-ops are encountered. This feature may be suppressed by use of the LAP (Leave Automatic Paging) pseudo-op. EAP If the user has previously suppressed the automatic paging feature, it may be restored to operation by use of the EAP (Enter Automatic Paging) pseudo-op. PAGE The PAGE pseudo-op causes the current core page to be assembled as is. Assembly of succeeding instructions wi II begin on the next core page. No argument is required. REORG The REORG pseudo-op is similar to the PAGE pseudo-op, except that a numerical argument specifying the relative location within the subprogram where assembly of succeeding instructions is to begin must be given. A REORG below 200 may not be given. A REC RG shou Id a Iways bs to ths fl iSt addisss of a core page . If a REORG address is not the first address of a page, it wi 11 be converted to the first address of the page it is on. Examples: CPAGE 0200 7200 0400 7040 1000 7041 START, CLA PAGE CMA REORG CIA 1000 The CPAGE pseudo-op followed by a numerical argument N specifies that the following N words of code* must be kept together in a single unit and not be split up by page escapes and literal tables. If the N words of code wi 11 not fit on the current page of code, the current page is assembled as if a PAGE pseudo-op had been encountered. The N words of code wi !! then be assembled as a unit on the next core page. NOTE N must be less than or equal 200 (octal) in nonautomatic paging mode or less than or equal 176 octal in automatic paging mode • *Normally data. However, if these N words are instructions (for example, a JMS with arguments), it is the user 1 s responsibility to count extra machine instructions which must be inserted by SAB R. 2-2 Example: START I IF CLA LAP CPAGE 200 NAME 1 NAME2 /INHIBIT PAGE ESCAPE /CLOSES THE /CURRENT PAGE /&ASSEMBLES THE /NAMES ON THE /NEXT PAGE. ihe conditional pseudo-op, iF, is used with the foi iowing syntax: IF NAME, 7 The action of the pseudo-op, so given, is to first determine whether the symbol NAME has been previously defined. If NAME is defined, the pseudo-op has no effect. If NAME is not defined, the next seven symbolic instructions (not counting null lines and comment lines) wi II be treated as comments and not assembled. Example: /ABSYM NAME 176 IF NAME, 2 /THE NEXT LINE TO BE CLL RTL /ASSEMBLED WILL BE RAL /"DCA LOC". /IF THE SLASH BEFORE 11 ABSYM NAME 176 11 IS /REMOVED, THE 11 CLL RTL" AND 11 RAL 11 WILL /BE ASSEMBLED. DCA LOC Norma fly the symbol referenced by an IF statement shouid be either an undefined symbol or a symbol defined by an ABSYM statement. If this is done, the situation mentioned below cannot occur. WARNING In a situation such as the fol lowing, a specia I restriction applies. /EXAMPLE: NAME, 0 IF NAME, 3 2-3 The restriction is that if the line NAME, 0 happens to occur on the same core page of instructions as the IF statement, then, even though it is before the IF statement, NAME wi 11 not have been previously defined when the IF statement is encountered, and on the first pass (though not in the listing pass) the three lines after the IF statement wi 11 not be assembled. The reason for this is that location tags cannot be defined unti I the page on which they occur is assembled as a unit. 2 .2 SYMBOL DEFINITION ABSYM An absolute core address may be named using the ABSYM pseudo-op. This address must be in the same core field as the subprogram in which it is defined. The most common use of this pseudo-op is to name page zero addresses not used by the operating system. These addresses are listed in Appendix D. OPDEF SK PDF Operation codes not already included in the symbol table may be defined by use of the OPDEF or SKPDF pseudo-ops. Non-skip instructions must be defined with the OPDEF pseudoop and skip-type instructions must be defined with the SKPDF pseudo-op. Examples of ABSYl·.1, OPDEF end SKPDF syntax: ABSYM ABSYM OPDEF SK PDF SK PDF TEM AX DTRA DTSF SMZ 177 10 6761 6771 7540 /PAGE ZERO ADDRESSES /A NON-SKIP INSTR. /SKIP-TYPE INSTRUCTIONS NOTE ABSYM, OPDEF and SKPDF definitions must be made before they are used in the program. COM MN The COMMN pseudo-op is used to name locations in field l as externa Is so that they may be referenced by any program. If any COMMN statements are used, they must occur at the beginning of the source, before everything else including the ENTRY statement. COMMON storage is always in field l and is allocated from location 0200 upwards. Since the top page of field l is reserved, no more than 3840 words of COMMON storage may be 10 defined. A COMMN statement normally takes a symbolic address label, since storage is being allocated. However, COMMON storage may be allocated without an address label. 2-4 A COMMN statement always takes a numerical argument which specifies how many words of COMMON storage to be allocated; however, aO argument is allowed. A COMMNstatement with 0 argument allocates no COMMON storage; it merely defines the given location symbol at the next free COMMON location. The syntax of the COMMN statement is shown below. Example: A, B, c, D, 20 COMMN COMMN COM MN COMMN COMMN ENTRY 10 300 0 10 SUB RUT In this example 20 words of COMMON storage are allocated from 0200 to 0217, and A is defined at location 0200. Then, 10 words are a 11 ocated from 0220 to 0227, and B is defined at 0220. Notice that if A is actually a 30 word array, this example equates B(l) with A(21). The example continues by allocating COMMON storage from 0230 to 0527 with no name being assigned to this block. Then 10 words are allocated from 0530 to 0537 with both C and D being defined at 0530. 2 .3 DAT A GENERATING BLOCK The BLOCK pseudo-op given with a numerical argument N wi II reserve N words of core by placing zeros in them. This pseudo-op creates binary output, and thus may have a symbolic address label. Before the N locations are reserved, a check is made to see if enough space is avai fable for them on the current core page. If not, this page is assembled and the N locations are reserved on the next core page. The action here is similar to that of the CPAGE pseudo-op. Similar restrictions on the argument apply. /EXAMPLE OF HOW LARGE BLOCK STORAGE /WITHIN A SUBPROGRAM AREA MAY /BE ACHIEVED: /INHIBIT PAGE ESCAPES /RESERVE 500 /(OCTAL) LOCATIONS LAP BLOCK 200 BLOCK 200 BLOCK 100 EAP /RESUME NORMAL CODING 2-5 As a special use, if the BLOCK pseudo-op is used with a location tag (but with no argument or a zero argument), no code zeros are assembled; instead the symbolic address label is made equivalent to the next relative core location assembled. (This is equivalent to using a symbolic address label with no instruction on the same line.) Examples: TEXT LIST, BLOCK 3 NAMEl, NAME2, NAME3, NAME4, BLOCK BLOCK 0 /ASSEMBLES AS /3 ZEROS WITH 11 / LIST" DEFINED /AT THE lST LOCATION /DEFINES NAME 1 = /NAME2 = NAME3 = /NAME4 BLOCK 2 The TEXT pseudo-op is used to obtain packed six-bit ASCII text strings. Its function and use are a I most exactly the same as for the BLOCK pseudo-op except that instead of a numerical argument, the argument is a text string. In particular, a check is made to be sure that the text string will fit on the current page without being interrupted by literals, etc. The text string argument must be contained on the same line as the TEXT pseudo-op. Any printing character may be used to delineate the text string. This character must appear at both the beginning and the end of the string. Carriage return, line feed and form feed are illegal characters within a text string (or as delineators). All characters in the string are stored in simple stripped six-bit form. Thus, a tab character (ASCII 211) will be stored as an 11, which is equivalent to the six-bit for the letter I. In general, characters outside the ASCII range of 240-337 should not be used. Example: 0200 0201 0202 0203 0204 0205 0206 0207 0210 0211 2405 3024 4005 3001 1520 1405 4061 6263 5273 7700 TAG, 2-6 TEXT /TEXT EXAMPLE 123*; ?/ 2 .4 EXTERNAL SUBROUTINE SABR and the Linking Loader possess extensive capabilities for calling external subprograms and for passing arguments between them. In addition to the foci lities mentioned in this section, COMMON storage is also available (refer to Section 2 .2). For example, a user wishes to write a long main program, MAIN, which uses two major subroutines, S 1 and S2. S 1 requires two arguments and S2 requires one argument. The user would then write MAIN, S 1 and S2 as three separate programs in the fol lowing fashion: MAIN, CLA /START OF MAIN END ENTRY sl , ENTRY S2! Sl BLOCK 2 RETRN Sl END S2 BLOCK 2 RETRN S2 END He would then assemble each of these subprograms with SABR and load all of them with the Linking Loader. MAIN would contain statements in the form CALL ARG ARG CALL ARG 2, x s1 y 1, S2 z Also Sl could contain CALLs to S2 or S2 CALLs to Sl. In addition, any of the subprograms could make use of DUMMY variables. During the loading process all of the proper addresses will be saved in tables so that when the user begins execution of MAIN, the Run-Time Linkage Routines (see Section 3 .3 .4), which were automatically loaded, will be able to execute the proper reference. Thus, MAIN will be able to fully use S 1 and S2 and be able to pass data to and receive it from them. The particular pseudo-operators required to make use of these foci Ii ties are described next. 2-7 2 .4. l The CALL and ARG Statements The CALL and ARG statements are the usual means of calling an external subroutine. For example, a subroutine named SUBR with two arguments can be called by another program with the instruction sequence: TAG, Nl I N2, ETC, CALL ARG ARG 2 I SUBR (50 LOCATN A CALL statement must contain both the number of arguments and the ENTRY point of the subprogram being cal led in that order and separated by a comma. Arguments may or may not have address labels. Constant arguments may be specified as literals for the reason explained below. However, true constant arguments may also be specified. The above instructions are assembled as follows: CPAGE 6 TAG, JMS LINK 020X (06) Nl I CDF CUR (05) POINTER N2, CDF CUR or CDF 10 LOCATN /Make sure the fol lowing /2N + 2 words wi II /fit on the current core page. /Ca II the CALL Linkage Routine, /where 2 =the number of /arguments and X = /the loca I number of the /subprogram being called /viz., SUBR. /Field address of argument /in form of a CDF instruction. /Address in the literal /table where the 50 is / assemb Ied . /Field of the argument /depending on whether it is /or is not in COMMON. /Address of argument. When a subprogram is referenced in a CALL statement, the Run-Time Linkage Routine, LINK; always executes the transfer to the subprogram as follows. First, it assumes that the ENTRY point to the subprogram is a two-word block. Into the first word of this block it places the number of the field where the CALL to the subprogram occurred. In the second word, it places the address where the CALL occurred, plus 2. In the example above SUBR would receive a 62Ml where TAG is in field M, and SUBR# would receive the address of Nl. If there were no arguments, SUBR# would receive the address of ETC. Thus, the two-word block at the ENTRY point serves as storage for the 15-bit address vector for picking up arguments and also for returning from the subprogram. 2-8 Execution of the subprogram begins at the first location following the two-word ENTRY block. The number of arguments in a CALL sequence must be less than 64 10 • The ARG statement may be used only in conjunction with a CALL statement. When the ARG pseudo-op is used with a literal, as in the above examples, the actual literal (50 in this case) wi II be generated in the litera I table, and in the location following the CDF CUR, there will be generated a relocatable pointer to the literal. This is the same as using a literal as a parameter. If the .l\.RG statement is used with a true constant argument, the constant itself is assembled in the location following the CDF instruction. In this case, the CDF is useless and is always just a meaning less space fi lier. The advantage of using the ARG - literal method is that it allows a subroutine to pick up an argument which is sometimes a variable and sometimes a constant. 2 .4.2 The ENTRY and DUMMY Statements ENTRY The ENTRY pseudo-op is used at the beginning of a subprogram to name its entry point, and define this symbol as an external for the Linking Loader. The ENTRY statement must occur before the symbolic name of the entry point appears as a symbolic address label. The actual entry location must be a two-word reserved space so that both the return address and field can be saved when the routine is called. Example: ENTRY SUBROU, SUBROU BLOCK 2 CLA For convenience of picking up subprogram arguments following a CALL statement, an ENTRY acquires all the properties of a DUMMY variable. DUMMY A DUMMY variable is a special type of variable in the FORTRAN/SABR system. It must be so defined in the subprogram which references it. When referenced directly a DUMMY variable is treated the same as any other local symbol. However, when referenced indirect~y it causes a ca II to the DUMMY Variable Run-Time Linkage Routine. This Linkage Routine assumes that the DUMMY variable is a two-word vector such that the first word is a 62N 1 (where N =the field of the address to be referenced) and the second word contains the actua I 12-bit address to be referenced . 2-9 DUMMY variables are used for passing arguments to and from subroutines. (See Section 2.4.4.) Example: AI ENTRY DUMMY DUMMY x y BLOCK 2 AI, x, M N Y, 2.4.3 The RETRN Statement The RETRN statement is used to return from a subprogram to the calling program. The name of the subprogram being returned from must be specified so that the Return Linkage Routine can determine the action required / and because a subprogram may have differently named entry points. It is possible for the careful user to return to the location following the fast colt of any subprogram merely by specifying it in a RETRN statement. Example: TAG, RETRN SUBROU Before the RETRN statement is used, the user must be sure to increment the pointer in the second word of the subprogram entry to the proper point beyond all the arguments following the CALL statement. An example of how this is done is given below. 2.4.4 Picking up Subprogram Arguments An advanced technique for picking up subprogram arguments is provided because: a. Subprogram arguments are two-word addresses and a subprogram CALL is executed by the Run-Time Linkage Routine. b. The calling program and subprogram may reside in different fields. A subprogram entry point is assumed to have been defined as a two-word reserved block and defined as an ENTRY. The appearance of the subprogram name in an ENTRY statement gives the twoword block the properties of a DUMMY variable. This means that when the subprogram name is referenced indirectly this generates a call to the DUMMY Variable Run-Time Linkage Routine where the details of locating and picking up the argument address words are worked out. Thus, the user, need only use the number sign feature to increment the argument pointer in the second word of the entry point. 2-10 The fol lowing example shows how SUBR would pick up the arguments 50 and LOCATN in the example and deposit them in LOCl and LOC2. Example: /MAIN MAIN, PROGRAM CLA TAG, Nl I N2, ETC, CALL ARG ARG 2,SUBR (50 LOCATN END /SUBROUTINE SUBR, ENTRY SUBR DUMMY TEM 2 BLOCK TAD I SUBR DCA INC TAD I TEM SUBR# SUBR DCA TAD I DCA INC TEM# TEM LOCl SUBR# /fHIS GIVES YOU THE FIELD ADDRESS /(CDF CUR) OF THE (50 /I.E., THE CONTENTS OF Nl /fO FIRST WORD OF DUMMY /MOVE ARG PTR TO Nl# /GET ADDRESS OF (50 /I.E., CONTENTS OF Nl# /fO 2ND WORD OF DUMMY /PICK UP THE 50 /MOVE ARG PTR TO N2 Similar method to pick up contents of LOCATN. TEM, INC RETRN BLOCK SUBR# SUBR 2 /MO VE PTR FOR RETURN AT ETC Constant arguments are specified as literals because the subprogram may not know that a constant argument is being used. Hence, specifying constant arguments as litera Is wi II ensure that the second word of every assembled argument is actually the address of the argument. The ARG statement may be used with a constant (e.g., if a constant address is intended). The following technique may be used if SUBR can assume that the first argument is always a constant: 2-11 Example: /MAIN PROGRAM TAG, CALL Nl, ARG N2, ARG ETC, 2, SUBR 50 LOCATN END /SUBROUTINE SUBR, ENTRY DUMMY BLOCK INC TAD I SUBR TEM 2 SUBR# SUBR DCA INC LOCl SUBR# 2-12 /MOVE ARG PTR TO Nl# /THIS GETS THE 50 /IMME DIA TEL Y /GET C(LOCATN) IN /THE USUAL WAY CHAPTER 3 THE ASSEMBLED BINARY CODE Because SABR is not a one-for-one assembler, it is necessary to give a general description of the type of code which it produces. The ordinary user needs only a general understanding of this topic; a more detailed discussion is included for the advanced user. 3. l THE BINARY OUTPUT TAPE SABR outputs each machine instruction on binary output tape as a 16-bit word contained in two 8-bit frames of paper tape. The first four bits contain the relocation code used by the Linking Loader to determine how to load the data word. The last twelve bits contain the data word itself. Relocation Code High Order of Data Word first frame second frame Low Order of Data Word The assembled binary tape is preceded and followed by leader/trailer code 200. The checksum is contained in the last two frames of tape before the trailer code. It appears as a normal 16-bit word as shown below. 0 0 High Order of Checksum 0 Low Order of Checksum first frame second frame All assembled programs have a relative origin of 0200. 3.2 THE LOADER RELOCATION CODES The four-bit relocation codes issued by SABR for use by the Linking Loader are al I explained below. The codes are given in octal. 00 Absolute Load the data word at the current loading address. No change is required. Example: 0205 5277 0242 0356 7500 0020 3-1 JMP LOC where LOC is at 0277 (on page) SMA 20 (a constant) 01 Simple Relocation Add the relocation constant to the word before loading it. (The relocation constant is 200 less than the actual address where the first word of the program is Ioaded . ) Items with this code are a Iways program addresses. Example: 0376 0520 01 A, LOC2 In the above example, LOC2 is at relative address 0520. If the first word of the program (relative address 0200) is loaded at 1000, then the actual address of A is 1176 and location 1176 will be loaded with the value 1320, which will be the actual address of LOC2 when loaded. 03 External Symbol Definition* The data word is the relative address of an entry point. Before entering this definition in the Linkage Tables so that the symbol may be referenced by other programs at run-time, the Linking Loader must add the relocation constant to it. The six frames of paper tape fol lowing the two-frame definition are the ASCII code for the symbol. Example: 03 l address address Iow order L 0 c 2 space space 04 Reorgin* Change the current loading address to the value specified by the data word plus the relocation constant. 05 CDF Current The data word is always a 6201 (CDF) instruction which has been generated automatically by SABR. The code 05 indicates to the Linking Loader that the number of the field currently being loaded into must be inserted in bits 6-8 before loading. Example: 0300 0301 6201 1776 05 0376 0520 01 A, TAD LOC2 where LOC2 is off page so that the TAD instiUction must be indiiect. If the program containing this code is being loaded into field 4, relative location 0300 will be loaded with 6241. Such an instruction is referred to in this document as CDF Current. They are generated automatically by SABR when a direct reference instruction must be assembled as an indirect, and there is the possibility that the current data field setting is different from the field where the indirect reference occurs. *Does not appear in assembly listings. 3-2 06 Subroutine Linkage Code The data word is a special constant enabling the Linking Loader to perform the necessary linking for an external subroutine call. (c. f., CALL Pseudo-op, Section 2 .4) The structure of the data word is shown below. Bits 0 - 5 Bits 6 - 11 4 - number of arguments _ . 4- local program __,. fol lowing the CALL number assigned to the extern a I subroutine being called. Before the 12-b it, two-part code word is Ioaded into memory, a global external number wi 11 be substituted for the local external symbol number in the right half of the data word. Example: 0200 0201 4033 0307 06 CALL 3, SUB ARG X ARG Y ARG Z Here, SUB has been assigned the local number 07 during assembly. At loading time this number wil I be changed to the global number (for example, 23), which is assigned to SUB. In this example, 0323 would actually be loaded at relative address 0201. 10 Leader/Trailer* and Checksum 12 This code represents normal leader/trailer. At the first occurrence of this code fol lowing the assembled program, the computer word contains the checksum. The data \A/ord is the highest location in Field 1 assigned to COMMON storage by the program. This item will occur exactly once in every binary tape and it must be the first word after the leader. If no COMMON storage has been allocated in the program, the data word wi 11 be 0177. 17 Transfer* Vector Signifies that reference to an external symbol occurs in the assembled program. The 12-bit data word is meaningless. The next six frames contain the ASCII code for the symbol. The Linking Loader uses this definition to create a transfer table, whereby local external symbol numbers assigned during assembly of this particular program can be changed to the global external symbol number when several programs are being loaded. 3 .3 PAGE ASSEMBLY SABR assembles page-by-page rather than one instruction at a time. This is accomplished by bui Iding various tables as instructions are read. When a ful I page of instructions has been collected *Does not appear in assembly listings. 3-3 {counting literals, off-page pointers and multiple word instructions) the page is assembled and punched. Several pseudo-ops also cause a page to be assembled. 3.3. 1 Page Format A normal assembled page of code has a format as shown below. xooo Assembled Instructions Page Escape Li tera Is and Off-Page Pointers X377 Page Escape Literals and off-page pointers are intermingled in the table at the end of the page. 3.3.2 Page Escapes Under normal circumstances SABR is in Automatic Paging Mode. This mode causes SABR to connect each assembled core page of code to the next page by an appropriate jump. This is called a Page Escape . For the Iast page of code, SABR Ieaves the Automatic Paging Mode and issues no Page Escape. Also., a pseudo-op is available to turn off this Automatic Paging Mode. There are two types of Page Escapes, depending on whether or not the last instruction is a skip instruction. If the last instruction was not a skip instruction, the Page Escape is as fol lows: last instruction (non-skip) 5377 (JMP to x 177) Iiterals and off-page pointers x177/NOP If the last instruction was a skip instruction, the page escape takes four words as follows: last instruction (a skip) 5376 (JMP to x 176) 5377 (JMP to x 177) Iiterals etc. xl76/SKP x177/SKP 3-4 3.3.3 Multiple Word Instructions Certain instructions in the source program require SABR to assemble more than one instruc- tion (e.g., off-page indirect references and indirect references where a data field re~setting may be required). In the Iisting, the source instruction wil I appear beside the first of the assembled binary words. A difficulty arises when a multiple word instruction follows a skip instruction. In such a case, extrn instructions must be assembled to enable the skip to be effected exactly as desired by the programmer. 3.3.4 Run-Time Linkage Routines The routines described in this section are entirely automatic. The user needs to know nothing about them except to better understand the program assembly listing. Many of the multiple word instructions involve use of special linking routines called the Run-Time Linking Routines. These routines make up a special portion of the 8K FORTRAN/SABR System. They are used at execution time by al I user programs to carry out the linkage for cal Is to externai subroutines and for al i the various forms of off-fieid and off-page indirect memory references. Since the Linkage Routines are needed by al I user programs, their use is entirely automatic. The user need not consider them either at programming time or at loading time. SABR determines when cal Is to the Linkage Routines are required in the user's program and automatically generates such cal Is. The Linking Loader a!·ways automatica! !y !cads the Linkage Routines. The residence of the Linkage Routines is described in Appendix D. There are seven Linkage Routines: a. change Data Field to current and skip CDFSKP b. change Data Field to one (COMMON) and skip CD ZS KP c. off page indirect reference linkage OPISUB d. off bank (COMMON) indirect reference linkage OBISUB e. DUMMY variable indirect reference linkage DUMSUB f. subroutine CALL linkage LINK g. subroutine RETURN linkage RTN The fol lowing is a description of the individual Linkage Routines. a. CDFSKP is cal led when a direct off-page memory reference, requiring that the data field be reset to the current field, fol lows a skip-type instruction. 3-5 Example: Program Assembled Code SZA DCA LOC 7440 4045 7410 3776 Meaning call CDFSKP SKP in case AC = 0 at .-2 execute the DCA via a pointer near the end of the page. b. CD ZS KP is cal led when a direct memory reference is made to a location in COMMON (which is always in Field 1), the action of CDZSKP is the same as that of CDFSKP except that it always executes a CDF 10 instead of a CDF current. Example: Program SZA DCA CLOC c. Meaning Assembled Code 7440 4051 7410 3776 call CDZSKP SKP in case AC = 0 at .-2 execute the DCA via a pointer near the end of the page. OPISUB is cal led when there is an indirect reference to an off page location. Example: Program Assembled Code Meaning DCA I PTR 4062 0300 01 3407 call OPISUB relative address of PTR execute the DCA I via 0007 d. OBISUB is called when there is an indirect reference to a location in COMMON. In such a case it is assumed that the location in COMMON which is being indirectly referenced points to some location that is also in COMMON. Example: Program DCA I CPTR Assembled Code Meaning 4055 1000 3407 call OBISUB address of CPTR in Field l execute the DCA I via 0007 e. DUMSUB is cal led when there is an indirect reference to a DUMMY variable. In such a case, DUMSUB assumes that the DUMMY variable is a two-word vector in which the first word is a 62N l, where N =the field of the address to be referenced, and the second word is the actual address to be referenced • 3-6 Example: Program DCA ! D UMV AR Assembled Code Meaning 4067 0300 01 3407 ca!! DUMSUB relative address of DUMVAR execute DCA I via pointer in location 0007 f. LINK is called to execute the linkage required by a CALL statement in the user's program. When a CALL statement is used, it is assumed that the entry point of the subprogram is named in the CALL and that this entry point is a two-word, free biock fol lowed by the executable code of the subprogram. LINK leaves the return address for the CALL in these two words in the same format as a DUMMY variabie. Example: Program CALL 2, SUBR ARG X ARG C g. Meaning Assembled Code 4033 0205 06 62Ml 0300 01 6211 1007 cal I LINK code word X resides in field M relative address of X C is in COMMON absolute address of C RTN is cal led to execute the linkage required by a RETRN statement in the user's program. Example: Program RETRN SUBR 3.3.5 Assembled Code Meaning 4040 0005 06 call RTN number of the subprogram being returned from (SUBR) Skip Instructions In page escapes and in multiple word instructions, skip-type instructions must be distin- guished from non-skipping instructions. For this reason, a special pseudo-op, SK PDF, must be used to define skip instructions not in the permanent symbol table. This also explains why both ISZ and INC are included in the permanent symbol table. ISZ is considered to be a skip instruction and INC is not. INC should be used to conserve space when the programmer desires only to increment a memory word with no possibility of a skip resulting. Example l shows the code which is assembled for an indirect reference instruction to an off page location following an INC instruction and Example 2 shows the same instruction following an ISZ instruction. In Example 1, it is assumed there is no possibility of the INC instruction actually causing a skip. 3-7 Example INC TAD POINTR LOC2 0220 0221 0222 0223 2376 4062 0520 1407 0220 0221 0222 0223 0224 0225 2376 7410 5226 4062 0520 1407 01} off page indirect execution Example 2 ISZ TAD I 3 .4 COUNTR LOC2 skip to execution jump over execution 01} off page indirect execution PROGRAM ADDRESSES Since each assembly is relocatable, the addresses specified by SABR always begin at 0200 and all other addresses are relative to this address. At loading time, the Linking Loader will properly adjust all addresses. For example, if 0200 and 1000 are the relative addresses of A and B, respectively, in the assembled program, and if A is loaded at 2000, then B will be loaded at 1000 + 1600 or 2600. Al I programs to be assembled by SABR must be arranged to fit into one field of memory not counting page 0 of the field or the top page (7600 - 7777) of the field. If a program is too large to fit into one field, it shou Id be split into several subprograms. Explicit CDF or CIF instructions are not needed by SABR programs because of the availability of external subroutine calling and COMMON storage. Explicit CDF or CIF instructions cannot be properly assembled by SABR. 3.5 THE SYMBOL TABLE Entries in the symbol table are variable in length. A one or two character symbol requires three symbol table words. A three- or four-character symbol requires four words, and a five- or six-character symbol, five words. Thus, for long programs it may be to the user's advantage to use short symbols wherever possible. The symbol table, not counting permanent symbols, contains 2644 words of storage. How10 ever, this space must be shared with the table when unresolved forward and external references are temporarily stored as two-word entries. If we may assume that a program being assembled never has more than 100 of these unresolved references at any one time, this leaves 2464 words of storage 10 10 for symbols. Using an average of four words per symbol, this al lows room in the program for 616 10 symbols. Symbol table overflow is a fatal error condition which generates the error message S. 3-8 CHAPTER 4 SABR OPERATING PROCEDURES This chapter describes how to assemble a program source using SABR. The procedure for loading a binary tape of an assembled program is described in Chapter 6. 4. l LOADING SABR IN A BASIC PDP-8 SYSTEM Procedure Make sure the Binary Loader is in memory, say in field n. 2 Set the console switches as fol lows: Instruction Field = n, Switch Register= 7777. 4.2 3 Press LOAD AD Dress. 4 Insert the SABR binary tape into the reader. 5 If using the high-speed reader, depress Switch Register Bit 0. 6 Press ST ART. 7 SABR will now be loaded into memory by the Binary Loader; portions of SABR wi 11 load into field 0 and field 1. LOADING SABR IN A DISK MONITOR SYSTEM Procedure .J. Make sure the Disk Monitor is in memory. 2 1 (Type CTRL/C or ST ART at 07600. ) When the Monitor responds with a dot, call the system Loader as follows: .LOAD) ()represents typing the RETURN key) 3 Insert the SABR binary tape in the reader. 4 Answer the loading command dialogue as fol lows: * IN-R:) for high speed reader or *IN-T:) for ASR reader * *ST= ) t <CTRL/P> t <CTRL/P> After typing the second CTRL/P t it is necessary to reposition the tape in the reader for Pass 2. t CTRL/C and CTRL/P are typed by holding down the CTRL key while typing the C or P key. 4-1 Procedure 5 SABR is now loaded into memory, partly in field 0 and partly in field l. It may be saved on the user's system device by responding to the monitor's dot as follows: . SAVE SABR! 0-7177;200) . SAVE SABl ! 700, 1700-12427; ~ 6 SABR is now saved on the user's system device and may be cal led as follows: • SABl ) .SABR) The field l portion must be called first. 4.3 OPERATING SABR It is assumed that the programmer has written his program in SABR language and punched this source program on paper tape in ASCII code. The source tape may have been sp Ii t into severe I separate tapes by placing a PAUSE statement at the end of each section except the last. The last tape must have an END statement at the end. After SABR has been ioaded into memory, it is used to assembie the source program. In Pass l the relocatable binary version of the user's program is created and, at the end of this pass, the symbol table is either typed or punched, according to whether this listing is to be typed or punched. Pass 2 is the listing pass. The assembly is carried out as follows. NOTE If SABR has been saved on the System I/O device, as in Section 4.2, it will start automatically at Step 3 below when called into memory. The source tape (first section) should be inserted in the reader before operation begins. Procedure Set the console switches as fol lows: Data field = 0, Instruction Field = 0, Switch Register = 0200. 2 Press LOAD AD Dress and START. 3 SABR now types a sequence of two or three questions; HIGH SPEED READER? HIGH SPEED PUNCH? LISTING ON HIGH SPEED PUNCH? 4-2 Procedure These questions must be answered with Y if the answer is yes. Any other answer is assumed to be no. The third question is typed oniy if the second is answered Y. If the third is answered Y, both the symbol table and the listing are punched on the high-speed paper tape punch. Otherwise, they are typed on the teletypewriter. The user need not wait for the ful I question to be typed before responding. 4 As soon as SABR has echoed the user's response to the last question, turn on the punch device and, if it is being used, the ASR reader. If the low-speed reader is used, the error message E indicates that the user has waited too Iong before turning the reader on. The user must begin again. 5 At this point, Pass l begins. SABR reads the source tape and punches the binary tape. After the binary tape has been completed, SABR types or punches the program symbol table. 6 If the source tape is in several sections (separate tapes with PAUSEs at the end of all except the last), SABR halts at the end of each section. At this point, insert the next section in the reader and then press CONTinue. 7 At the end of Pass 1, SABR halts. 8 If an assembly listing is desired, reposition the beginning of the source tape in the reader and if using the ASR reader, set it to ST ART, and then press CONTinue. 9 At the end of Pass 2, SABR again halts. To restart SABR for assembling another program, press CONTinue. 10 To restart SABR at any time, press STOP, set the Switch Register= 0200, press LOAD AD Dress and START. However, the first pass must always be repeated. 11 4.4 After assembling in a Disk Monitor environment, control may be returned to Monitor by restarting at iocation 7600. OPERATING PROCEDURE FOR USE AS FORTRAN PASS 2 In addition to being a stand-alone assembler, SABR also serves as Pass 2 of 8K FORTRAN compilation. For this purpose, the use of SABR is slightly different from that described in Section 4.3. However, SABR must stil I be loaded into memory as described in Section 4. l or 4.2. This difference in the operation of SABR is due only to the unusual format of the FORTRAN Compiler Pass l. The Compiler, in one pass, converts the user's FORTRAN source into a symbolic machine language program tape. SABR then converts the symbolic tape into relocatable binary. However, the symbolic tape produced by the Compiler is not a standard format SABR language tape. It is arranged as shown below. 4-3 L E A D E R s F E p A R A T 0 R T R Main part of program; Executable code. END Symbol Definitions Common, Arrays, Data and Program Entry point. 0 p A u s E T R A I L E R R \ 'True Start 3 ft of blank tape The tape is arranged this way because the data at the end of the tape cannot be inserted in the midst of the executable code, and some data which should be at the beginning of the tape is not known until later. Thus, the true start of the symbolic program is near the end of the symbolic tape, preceded by a segment of leader/trailer code and fol lowed by a PAUSE statement. To assemble such a tape with SABR, one of three methods must be followed. Actually, the general procedure is the same as that described in Section 4. 3, but it differs in special details. The differences are aii covered by the three methods expiained beiow. 4.4. l Method l The simplest method is to cut the symbolic tape into two parts. The cut should be made at the middle of the blank tape which separates the executable code from the symbol definitions. The latter section of the tape should then be marked "Section 1 11 and the former section (the executable code} should be marked "Section 2. 11 Assembly then proceeds with the two-part symbolic tape exactly as described in Section 4. 3. 4.4.2 Method 2 The user may avoid actually cutting the symbolic tape by manipulating the tape as if it were in two parts as explained above. The tape should initially be inserted in the reader with the separator blank tape over the read-head. When SABR halts at the PAUSE statement at the physical end of the tape, the user should reposition the tape, putting the physical beginning of the tape in the reader. Then press CONTinue. The assembly pass will end at the separator blank tape code. The assembly listing can be produced in a similar manner, pressing CONTinue to start the listing pass. 4-4 4.4.3 Method 3 The third method requires SABR to pass over the symbolic tape two times for each pass of the assembiy. However, it ai iows the tape to be inserted at its physi cai beginning. It is based on the fact that a symbolic tape output by the FORTRAN Compiler has as its physical first line the special pseudoop, FORTR. This pseudo-op has no effect except when a symbolic tape output by the Compiler is assembled using this third method. Procedure Insert the symboi i c tape in the reader at its physi cai beginning. 2 Start SABR as usual. 3 Sensing the FORTR statement as the first line, SABR ignores all further data until after it passes over the END statement. SABR then begins the actual assembly by processing the symbol definitions, etc., which are at the latter end of the tape. 4 Then, SABR halts at the PAUSE statement which is at the physical end of the tape. At this time the user should reposition the symbolic tape in the reader at the physical beginning of the tape, and then press CONTinue. SABR now assembles the executable code portion of the tape in the normal way. 5 If an assembly listing is desired, proceed as in Method 2 after SABR finishes the assembly pass. 4-5 CHAPTER 5 THE LINKING LOADER 5. 1 INTRODUCTION Relocatable binary program tapes produced by SABR assembly are ioaded into memory by using the 8K System Linking Loader. The Linking Loader is capable of loading and linking a user's program and subprograms in any fields of memory. It is even capable, in a special way, of loading programs over itself. The Linking Loader also has options which give storage maps and core availability. The Linking Loader requires a PDP-8/I, -8/L, -8, -8/S or -5 Computer with at !east 8K words of core memory. Either high-speed or ASR paper tape input is acceptable, however, a high- speed reader is highly recommended. The software requirements are: a. Binary paper tape copy of the Linking Loader b. Relocatable binary paper tape copies of both Part 1 and Part 2 of the 8K System Library c. The relocatable binary paper tapes of the user's own program and subprograms which have been produced by assembling his programs with SABR. 5.2 LOADING WITH THE LINKING LOADER Generally speaking, the Linking Loader is capable of loading any number of user and Library programs into any field of PDP-8 memory. These programs are loaded consecutively via the high-speed reader (or the ASR reader). The choice of which field to load each program into is a Switch Register option. Usually, several programs may be loaded into each field. Because of the space reserved for the Linkage Routines the available space in field 0 is three pages smaller than in all other fields. Any COMMON storage reserved by the programs being loaded is allocated in field 1 from location 0200 upwards. The space reserved for COMMON is obviously subtracted from the available loading area in field 1. The program reserving the largest amount of COMMON storage must be loaded first. The Linking Loader uses the following special method to enable loading data over itself. When the Linking Loader encounters data which must be loaded over itself, it punches this data onto paper tape in RIM format. Then, after the user has finished loading all his relocatable binary program tapes, he simply loads the RIM format tape using the standard RIM loader. The Run-Time Linkage Routines which are necessary to execute SABR programs (see Section 3. 3.4) are automatically loaded into the required areas of every field by the Linking Loader as a part of its initialization. For the user, the only required knowledge of these routines is the particular areas of core they occupy (see Appendix D). 5-1 The 8K System Library subprograms (See Appendix E), which may be used by any SABR program, are loaded in the same way as any other relocatable binary programs. Only those library programs which the user's programs actually call need to be loaded. 5.3 LOADING INFORMATION OPTIONS During the loading operation with the Linking Loader, two user options are available to obtain information about what has al ready been loaded. The Switch Register is used to select these options. Either option may be selected after any program has finished loading. I WARNING I If the ASR punch is turned on, it must be turned off before selecting these options. The Switch Register bits used are as follows: BIT 0 = l selects the Core Availability option; BIT l = 1 selects the Storage Map option. The Core Avai iabi iity option causes the number of free pages of memory In every fie id of memory to be typed in a list on the Teletype. For example, if the user has a 16K configuration, a list like the following might be typed. 0002 0010 0030 0036 (number of free pages in field O) (number of free pages in field l) (number of free pages in field 2) (number of free pages in field 3) The number of pages initially available in field 0 is 0033 and in all other fields is 0036. The Storage Map option causes a list of all program entry points to be typed, along with the actual address at which they have been loaded. The entry points of programs which have been called but which have not been loaded are also listed along with a U flag for undefined. Such flagged programs must be loaded before execution of the user's programs is possible. The Core Availability list is automatically appended to the Storage Map. A sample is shown below. MAIN READ WRITE IOH SETERR ERROR TTY OUT HS OUT 10200 01055 01066 03031 00000 u 00000 u 00000 u 00000 u 5-2 00000 u TT YIN HSIN FDV u CLEAR !FAD FMP ISTO STO FLOT FAD DIV !REM FSB FLOAT FIX IFIX CHS 0011 0033 5.4 00000 04722 05247 05131 04632 05074 04447 05210 04010 00000 00000 u 04000 05046 04513 04561 05231 u HOW TO LOAD THE LINKING LOADER The Linking Loader must be ioaded into the highest avaiiabie fieid of memory. Procedure Make sure the Binary Loader is in memory, for example, in field m. 2 Let h represent the number of the highest field in the user's configuration. 3 Set the console switches as follows: Data Field= h, Instruction Field= m, Switch Register= 7777. 5.5 4 Press LOAD AD Dress. 5 Place the binary paper tape of the Linking Loader in the reader. 6 If using a high-speed reader, depress Switch Register Bit 0. 7 Press START. The Linking Loader will now be loaded into memory. OPERATION OF THE LINKING LOADER The Linking Loader is used to load the user's relocatable programs and 8K Library subprograms as outlined below. NOTE The program or subprogram which uses the largest amount of COMMON storage should be loaded first. (The Library subprograms do not use COMMON.) 5-3 Procedure After the Linking Loader has been loaded into the highest memory field, h, the user should set the console switches as fol lows: Data Field= h, Instruction Field= h, Switch Register= 0200. 2 Press LOAD ADDress. 3 Place the relocatable binary tape for the first program to be loaded in the reader. Position the tape with leader code in the reader. 4 Set Switch Register to 0000. Then, if loading via the ASR reader is required, raise Switch Register Bit 6. If the user does not have a high-speed punch, he should raise Switch Register Bit 7. Finally, set Switch Register Bits 9-11 to the number of the field into which the first program or subprogram is to be loaded. Switch Register* I ~ I I21 1 1 1~ 1 1° I: I I I 3 4 5 7 1° 0 0 VI )> )> 0 V'l V'l 0 .., "U ....... 0.., Cl> "U co .., 0 Cl> ~ Q co ;::c Cl> 0 a_ 3 ..,Cl> "U ;::c 11 '"---....._,..---) Number of Loading Field c :J g.. Example: If the user wishes to load his first program into field 3, and if he has no highspeed VO device, then he should set the Switch Register to 0063 before the next step. 5 Press START. 6 The user's relocatable binary program wi 11 now be loaded. When loading is completed, the Linking Loader halts. 7 The user may now either load another program or select one of the options in steps 9 and 10. 8 To load another program, insert the program relocatable binary tape in the reader, set Switch Register Bits 9-11 to the number of the field the program is to be loaded into, and then press CONTinue. 9 To select the Core Availability option, set Switch Register Bit 0 = 1, and press CONTinue. 10 To select the Storage Map option, set Switch Register Bit 1 = 1, and press CONTinue. If the ASR punch is turned on for possible RIM format data punching, as explained in Section 5.2, ensure that it is turned off before selecting either of the options. Turn it on again after the typing of the option is completed. *Al I other Switch Register bits are irrelevant. 5-4 Procedure 11 The user may continue loading more programs as in step 8 after using either of the options. Any time the Linking Loader halts, the user may access memory directly via the DEPosit and EXAMine console switches. After this is done the Linking Loader may be restarted via the console switches at location 7200 (in the highest field, where the Linking Loader resides). 5-5 CHAPTER 6 DEMONSTRATION PROGRAM The following demonstration program is aSABRprogramshowingthe use ofthe libraryroutines. The program is written to add two integer numbers, convert the result into floating-point, and type the result in both integer and floating-point format. The source program was written and listed using the Symbolic Editor; the Disk Monitor System was used during assembly; and the assembled program was then ioaded and run using the 8K Linking Loader. The system configuration consisted of a PDP-8/I with 8K words of core, DF32 Disk, ASR33 Teletype, and high-speed reader and punch. The Disk Monitor System, Symbolic Editor, and SABR Assembler were available on the disk. The ASR33 paper tape reader was used during assembly for demonstration (printout) purposes. Demonstration Program Program Comment After writing the source program it was printed and punched using the Symbolic Editor. ENTRY START START, CALL TAD TAD DCA CALL ARG CALL ARG CALL ARG ARG CALL ARG CALL ARG CALL ARG HLT FORMT, TEXT N, 1 A, 2 2 g, c, 0 D, BLOCK END 0,0PEN A /INITIALIZE IO DEVICES /COMPUTE C = A + B 8 c J,FLOAT /CONVERT TO FLOATING POINT c 1, STO D 2,WRITE N FORMT 1,IOH /INITIALIZE THE IO HANDLER /DEVICE NUMBER 1 = TELETYPE /FORMAT SPECIFICATION /TYPE THE INTEGER NUMBER c 1, I OH /TYPE THE FLOATING POINT NR D 1, I OH 0 "C 'THE /COMPLETE THE IO ANSWERS ARE',IS,F7.2)" 3 6-1 Demonstration Program Comment CTRL/C was typed after the asterisk to return control to the Disk Monitor. * .SABl SABR was transferred from the disk into core. • Sl\BK The source program tape was placed in the teletype reader. When started, SABR printed its identification and initial dialogue questions which were answered. PDP-8 SABR DEC-08-A282-12 HIGH SPEED READER? N HIGH SPEED PUNCH? Y LI S TI NG 0 1-.J HI GH SP D:: D P !J r-.J CH ? N The TTY reader must be set to START within 3 seconds after typing N to the last question. Otherwise, as was the case here, the error message wi ti appear, and SABR must be restarted at location 0200, as was done here. E AT HIGH S?~ED READER? N HIGH SPEED PUNCH? Y LISTING ON HIGH SPEED PUNCH? N The initial dialogue questions are repeated and again answered. After typing the N to the last question, the TTY reader was immediately set to ST ART and assembly commenced. A 0257 B 026:,~ c D FLOAT FORMT IOH N OPEN START STD WRITE The Symbol Table concluded the assembly. 0 261 0262 00t2l0EXT 0240 0000EXT 0256 0000EXT 0200EXT 000f3EXT 000(2lEXT Here the source program tape was again placed in the TTY reader and the CONTinue switch was depressed. The program listing was printed. 6-2 Demonstration Program ENTRY START 0200 0201 0202 0203 02l;;J4 020 5 02t;;J6 020 7 0 2 l:?J 0211 0212 0213 0214 0215 0216 0217 0220 0221 0222 0223 0224 0225 0226 0227 0230 023i 0232 0233 0234 0235 0236 0237 S T_l\RT, 4033 001~2 1257 1260 3261 40 3 3 010 3 6201 0261 4033 010 4 6201 0262 4033 0205 6201 0256 6201 0240 4033 0106 6201 0261 4033 010 6 6201 0262 4033 010 6 621 1 0000 7402 0240 52J 4 7 0241 2410 0242 - 0540 0243 011 6 0244 2327 0245 0522 0246 2340 0247 0122 0250 0547 0251 5411 0252 6554 0253 0 667 0254 5662 0255 5100 0256 0001 0257 02102 0260 0002 0261 0000 0262 0000 0263 0000 0264 0000 CALL 0, OPEN /I NI TI ALI ZE TAD TAD DCA CALL A /COMPJTE c ARG c Ci\LL 1, STO ARG D CALL 2, WRITE /I NI TI ALI ZE ARG N /DEVICE NUMBER 1 ARG FORMT /FORMAT SPEC I FI CATI ON CALL 1, I OH /TYPE THE: INTEGER NUMBER ARG c CALL 1, I OH ARG D CALL 1, I OH ARG 0 IO DEVICES 06 06 05 01 06 05 01 06 05 01 05 01 06 05 01 06 05 01 B =A + B c 1,FLOAT /CONVERT TO FLO_C\TI NG POINT TH~ IO HANDLER = TELETYPE /TYPE THE FLOATING POINT NR /COMPLETE TH2: IO 06 HLT FORMT, TEXT "C 'THE ANSWERS ARE',I5,F7.2)" N, A, g, 1 2 2 0 BLOCK c, o, 3 END 6-3 Demonstration Program Comment Program The 8K Linking Loader was loaded into core using the Binary Loader, and started at location 0200 of field l. When started, the Linking Loader printed its identification. PDP-8 LINKING LOADER DEC-08-A283-05 ST,~RT OPEl\J FLO,AT STO WRITE IO:-! READ SETERR ERRO~ TTY OUT HS OUT TTYIN HSIN FDV CLEAR IFAD FMP ISTO FLOT FAD DIV IREM FSB FIX IFIX CHS ABS IABS Library Tape Part l was loaded into core by placing the tape in the TTY reader, setting the reader to START, and pressing CONTinue. 0100(2} 06125 05034 04444 0130 2 03142 01271 06200 After loading the library subprograms, Switch Register bit l was set to l, and CONTinue was pressed to get the storage page of the programs and subprograms loaded into core. 06303 0 6027 0 6~j 5 5 060 2!0 0 6045 1 0 4 71 1 05227 0 51 1 6 04623 0 50 61 0 5153 0 4010 0 5445 05616 0 42l 0 0 0 4510 04556 0 521 1 0 5636 05670 MPY 05400 IRDS'tJ CKI 0 EXIT CLRERR 05713 0 6121 0 6142 0 6231 0004 0036 The last two numbers represent the number of free {available) pages in each core field -- 0004 free pages in field 0, and 0036 free pages in field l. 6-4 Comment Program To execute the compiled program, the 5'witch Register was set to 01000, the starting address of the main program (determined from the Storage Map). The LOAD ADDress switch was pressed and then START switch was pressed. THE ANSWERS ARE 4 The program ran as planned, producing the desired results. 6-5 APPENDIX A ASCII* CHARACTER SET Character Code Character Code Character NULL BELL TAB LINE FEED FORM RETURN SPACE 200 0 l A B II # $ % & * + . I 207 211 212 2 3 260 261 262 263 214 4 264 E 215 5 265 F 240 6 266 241 242 243 244 245 246 247 250 251 252 253 254 255 7 267 270 271 272 273 274 275 276 277 G H 8 9 < > ? c D I J K L M N 0 p Q R s T u 256 v w x 257 y z 307 310 311 312 313 314 315 316 317 320 321 322 323 324 325 326 327 330 331 332 333 \ 334 335 336 337 377 RUBOUT A-1 301 302 303 304 305 306 rL ] *An abbreviation for U.S.A. Standard Code for Information Interchange. Code APPENDIX B PERMANENT SYMBOL TABLE Memory Reference Instructions Mnemonic Code AND 0000 TAD 1000 ISZ INC 2000 2000 DCA JMS 3000 4000 JMP I 5000 0400 Operation Event Time combine C(AC) and C(MEM) by logical AND and store result in AC combine C(AC) and C(MEM) by two's complement addition and store result in AC with carry added to the LINK increment C(MEM) and skip if result is 0 same as ISZ except should be used only when it is known that an actual skip cannot occur (see Section 3 .3 .5) deposit C(AC) into MEM and clear the AC jump to subroutine (actually deposit the current value of the PC into MEM and jump to /V\E.M + 1) jump to MEM location indirect memory reference Operate Microinstructions: Group 1 l""I A ' - L...r"\ CLL CMA CML RAR RTR RAL RTL IAC CIA STA STL NOP 7200 7100 7040 7020 7010 7012 7004 7006 7001 7041 7240 7120 7000 clear AC clear LINK comp Iement AC complement LINK rotate AC and LINK 1 bit right rotate AC and LINK 2 bits right rotate AC and LINK l bit left rotate AC and LINK 2 bits left increment AC negate AC (CMA IAC combined) set AC (C LA CMA combined) set LINK (CLL CML combined) no operation 1 2 2 4* 4* 4* 4* 3 1 ,3 1,2 1,2 1 Operate Microinstructions: Group 2 CLA SMA SZA SPA SNA SNL SZL 7600 7500 7440 7510 7450 7420 7430 clear AC skip if AC negative skip if AC zero skip if AC positive or zero skip if AC non-zero skip if LINK non-zero skip if LINK zero * 3 for PDP-8 B-1 2 1 1 l 1 1 1 Operate Microinstructions: Group 2 (Cont) Mnemonic Code Operation Event Time SKP SPC OSR 7410 7710 7404 l l HLT 7402 skip unconditiona I ly (SPA CLA combined} inclusive OR switch register with C(AC); result to AC halt IOT Microinstructions Program Interrupt ION IOF Keyboard/Reader KSF KRB Teleprinter/Punch TSF TLS High-Speed Reader (Type PC02) RSF RRB RFC High-Speed Punch (Type PC03) PSF PLS 6001 6002 turn interrupt on turn interrupt off 6031 6036 skip if keyboard/reader flag= 1 c fear AC & read keyboard buffer, and cf ear keyboard flag 6041 6046 skip if teleprinter/punch flag = 1 load teleprinter/punch buffer, select and print, and c Iear teleprinter/ punch flag 6011 6012 6014 skip if reader flag = l read reader buffer and c Iear flag clear flag and buffer and fetch character 6021 6026 skip if punch flag =l clear flag and buffer, load and punch Pseudo-Operators ABYSM ARG BLOCK CALL COMMN CPA GE DECiM DUMMY EAP END ENTRY FORTR IF LAP OCTAL OP DEF PAGE Direct Absolute Symbol Definition Argument for Subroutine Cal I Reserve Storage Block Ca 11 Externa I Subroutine Common Storage Definition Check if Page Will Hold Data Dec i ma I Conversion Dummy Argument Definition Enter Automatic Paging Mode End of Program Define Program Entry Point Assemble FORTRAN Tape Conditional Assembly Leave Automatic Paging Octal Conversion Define Non-Skip Operator Terminate the Page B-2 3 4 Pseudo- Operators (Cont) Mnemonic Operation Code PAUSE Pause for Next Tape REORG RETRN SK PDF TEXT Terminate Page and Reset Origin Return from External Subroutine Define Skip-Type Operator Text String Floating-Point Accumulator ACH Ar't..A 1-\\,,..IV\ ACL 20* 21* 22* high-order word middle woid low-order word *The Floating Point Accumulator is in field 1. B-3 APPENDiX C ERROR MESSAGES C. l SABR Because SABR is a one-pass automatic paging assembler for binary relocatable programs, object errors are difficult to correct. If there are errors in the source, the assembled binary code will be virtually useless. Both errors E and S are fatal; assembly halts when they are encountered. The other types of errors are not fatal, but they cause the line in which they occur to be treated as a comment and thus essentially ignored. An address label on such a line will remain undefined and no space is reserved in the binary output for the erroneous data. During the assembly pass error messages are typed on the teletype as they occur. Example: c AT LOC -+-0004 This means that an error of type C has occurred at the fourth instruction after the location tag LOC. This line count includes comment lines and blank lines. During the listing pass, the error is typed in the address field of the instruction line. The following error messages may occur. A Too many or too few ARGs follow a CALL statement. C An i Ilegal character appears on the line. This could possibly be an 8 or 9 in an octal digit string or an alphabetic character in a digit string. M A symbol is multiply defined (occurs only during Pass 1). It is impossible to resolve multiple definitions during Pass 2; therefore, listings of programs which contain multiple definitions wil I have unmarked errors. An illegal syntax has been used. Below are listed the types of illegal syntax that may occur. E a. A pseudo-op with improper arguments. b. A quote mark with no argument. c. A non-terminated text-string. d. A memory reference instruction with improper address. e. An i Ilegal combination of micro-instructions. There is no END statement. C-1 S one of the following: a. The symbol table has overflowed. This can be corrected by using fewer symbols, using shorter symbols, or by breaking the program into smaller parts. b. Common storage has been exhausted. c. /vbre than 64 different user-defined symbols have occurred in a core page. d. /vbre than 64 externa I symbo Is have been dee la red • One further type of error may occur. This is an undefined symbol. Because SABR is a onepass assembler, an undefined symbol cannot be determined unti I the end of the assembly pass, so the error diagnostic UNDF is given in the symbol table listing. (Refer to the discussion of the Symbol Table at the end of Appendix F .) C .2 LINKING LOADER If during the process of loading a program or subprogram the Linking Loader encounters an error, the user is notified by an error message; the partially loaded program or subprogram is ignored, removed from the field, and core is freed. The error messages are typed out in the form ERROR xx xx where XXXX is the error code number. Error Code Explanation 0001 More than 64 10 subprogram names have been seen by the Loader (6410 subprogram names is the capacity of the Loader's symbol table}. 0002 The current field is full, or load was to nonexistent memory. 0003 The current subprogram has too large a COMMON storage assignment. (Subprogram with largest common storage declaration must be loaded first.) This is a semi-fatal error. Re-initialize the Linking Loader as explained below and reload the programs in the proper order. 0004 Checksum error in input tape. If the error persists, reassembly is necessary. 0005 Illegal Relocation Code has been encountered. This can occur only if the relocatable binary tape is bad or if the user is using it improperly (e.g., not starting at the beginning of the tape, or reader error, or punch error). If the error persists, re-assembly is necessary. Recovery from errors 2, 4, and 5 is accomplished by repositioning the tape in the reader to the leader code at the beginning of the subprogram and then pressing CONTinue. When attempting to recover from one of these errors, no other program should be loaded before reloading the program which C-2 caused the error. Obviously, on Error 2 a different field should be selected before pressing CONtinue. The entire loadina Process mav be restarted via the console switches. at anvr time re- - - - bv -- / - "' I I I initializing the Linking Loader. To do this, set the console switches as fol lows: Data Field = h (the field where the Linking Loader resides), Instruction Field = h, Switch Register = 6200; then press LOAD AD Dress and ST ART. C.3 LIBRARY PROGRAM During execution, the Library programs check for certain errors and type out the appropriate error messages in the form 11 XXXX 11 ERROR AT LOC NNNN where XXXX specifies the type of error, and NNNN is the location of the error. When an error is encountered, execution stops, and the error must be corrected. When multiple error messages are typed, the location of the last error message is relevant to the user program. The other error messages are to subprograms cal led by the statement at the relevant location. Explanation Error Code 11 ALOG 11 Attempt to compute log of negative number 11 ATAN 11 Result exceeds capacity of computer 11 D1vz Attempt to divide by 0 11 11 EXP 11 Result exceeds capacity of computer 11 11 FIPW 11 FMTl 11 Error in raising a number to a power Multiple decimal points E or • in integer 11 FMT3 11 II lega I character in I, E, or F field 11 FMT4 11 Multiple minus signs 11 11 FMT5 Invalid FORMAT statement FLPVv'll Negative number raised to floating power 11 FPNT 11 Floating - point error may be caused by: Division by zero; floating - point overflow; attempting to fix too large a number. 11 SQRT 11 Attempt to square root a negative number II C-3 To pinpoint the location of a Library execution error: Step Procedure From the Storage Map, determine the next lowest numbered location (external symbol) which is the entry point of the program or subprogram containing the error. 2 Subtract in octal the entry point location of the program or subroutine containing the error from the LOC of the error in the error message. 3 From the assembly symbol table, determine the relative address of the external symbol found in step l and add that relative address to the result of step 2. 4 The sum of step 3 is the relative address of the error, which can then be compared with the relative addresses of the numbered statements in the program. C-4 APPENDIX D FREE PAGE 0 LOCATIONS Because the Library Linkage Routines must be in core when SABR assembled programs are run, certain core locations are not available as fol lows: Field 0 Fi e Id 0 , l , 2 , . . . Locations 0400 - 0777 Locations 0007 and 0033 - 0073 Thus in every field of memory the following page 0 locations are available to the user: 0000 - 0006 0010 - 0017 0023 - 0032 0074 - 0177 for interrupts, debugging, etc. auto-index registers arbitrary arbitrary Locations 20, 21, 22 in field l are used for the Floating-Point Accumulator. The user should use these locations with great care. When using the Library routines, locations 20-32 in the field where the routines reside, are used for temporary storage by the routines. Locations 176 and 177 in the field where the I/O handler routines (IOH) reside are used for temporary storage by the 1/0 handler. D-1 APPENDIX E THE LIBRARY SUBPROGRAMS The Library is a set of subprograms which may be CALLed by any FORTRAN/SABR program. The relocatable binary versions of these subprograms are arranged in two paper tapes for the convenience of the user. Part 1 contains those subprograms which are used by almost every FORTRAN/SABR program. All the Library subprograms are described below. Many of the subprograms reference the Floating-Point Accumulator located at ACH, ACM, ACL (20, 21, 22 of field 1), E. l INPUT/OUTPUT READ is called to initialize the I/O handler before reading data. WRITE is called to initia- lize the I/O handler before writing data. IOH is called for each item to be read or written. IOH must also be called with a zero argument to terminate an input-output sequence. (Refer to Chapter 6.) All of these programs require that the Floating-Point Accumulator be set to zero before they are called. Examples: rAI I \.,.r'\L.L. ARG ARG CALL ARG 2, READ (n /n =DEVICE NUMBER /fa =ADDR OF FORMAT fa l ,IOH data l /data l =ADDR OF HIGH /ORDER WORD OF /FLOATING POINT NUMBER CALL ARG 1,IOH data 2 CALL ARG 1,IOH 0 CALL ARG ARG 2,WRITE (n fa The following device numbers are currently implemented: 1. Teletype keyboard/printer 2. High-speed reader/punch E-1 E .2 FLOATING-POINT ARITHMETIC FAD is called to add the argument to the Floating-Point Accumulator CALL ARG 1, FAD addres FSB is called to subtract the argument from the Floating-Point Accumulator. CALL ARG l ,FSB addres FMP is called to multiply the Floating-Point Accumulator by the argument. CALL ARG l ,FMP addres FDV is called to divide the Floating-Point Accumulator by the argument. CALL ARG l ,FDV addres CHS is called to change the sign of the Floating-Point Accumulator r'-r'\L A 1 1 .. L. " rue Vt'-11..I All of the above programs leave the result in the Floating-Point Accumulator. The address of the high-order word of the floating-point number is 11 addres 11 • STO is cal led to store the contents of the Floating-Point Accumulator in the argument address CALL ARG l ,STO storag /storag =ADDRESS WHERE /RESULT IS TO BE PUT IFAD is called to execute an indirect floating point add to the Floating-Point Accumulator. CALL ARG l ,IFAD ptr /ptr =2-word POINTER /TO HIGH ORDER /ADDRESS OF FLOATING /POINT ARGUMENT ISTO is called to execute an indirect floating point store. CALL ARG l ,ISTO ptr CLEAR is ca Iled to c fear the Floating-Point Accumulator. CALL 0 ,CLEAR E-2 FLOT is caiied to convert the integer contained in the AC (processor accumulator) to a floating point number and store it in the Floating-Point Accumulator. FIX is called to convert the number in the Floating-Point Accumulator to a 12-bit signed integer and leave the result in the AC. CALL O,FIX ABS leaves the absolute value of the floating point number at 11 addr 11 in the Floating-Point Accumulator. CALL ARG E .3 1,ABS addr INTEGER ARITHMETIC MPY is called to multiply the integer contained in the AC by the integer contained in 11 addr. 11 The result is left in the AC. CALL ARG 1,MPY addr DIV is called to divide the integer contained in the AC by the integer contained in 11 addr. 11 The result is left in the AC. CALL ARG 1,DIV addr !REM leaves the remainder from the last executed integer divide in the AC. CALL ARG 1 ,IREM 0 (The argument is ignored.) !ABS leaves the absolute value of the integer contained in 11 addr 11 in the AC. CALL ARG 1 ,IABS addr IRDSW reads the value set in the console switch register into the AC. CALL 0 ,IRDSW E-3 E .4 SUBSCRIPTING SUBSC is called to compute the address of a subscripted variable. The address is left in the AC. When SUBSC is cal led, it assumes that the AC contains the first dimension of the array. This dimension should be positive if the subscripted variable is an integer, and negative if the subscripted variable is a floating point number. Example: Assume S is a 20 X 20 floating-point array. 8 8 E .5 (20 TAD CIA CALL ARG 3 ,SUBSC i1 ARG i2 ARG base /i 1 =ADDRESS OF 2ND /SUBSCRIPT /i2 =ADDRESS OF lST /SUBSCRIPT /BASE ADDRESS /OF ARRAY FUNCTIONS SQRT leaves the square root of the floating-point number at 11 addr 11 in the Floating-Point Accumulator. CALL ARG l ,SQRT addr SIN, COS, TAN leave the specified function of the floating-point argument at 11 addr 11 in the Floating-Point Accumulator. CALL ARG l ,SIN addr AT AN leaves the arctangent of the floating-point number at 11 addr 11 in the Floating-Point Accumulator. CALL ARG 1 ,ATAN addr ALOG leaves the natural logarithm of the floating-point number of 11 addr 11 in the FloatingPoi nt Ace umu lator. CALL ARG l ,ALOG addr E-4 EXP raises 11 e 11 to the power specified by the floating-point number at 11 addr 11 and leaves the result in the Floating-Point Accumulator. CALL ARG 1,EXP addr Ai I of these subprograms require that the Fioating-Point Accumulator be set to zero before they are called. E.6 POWERS (IIPOW I IFPOW I FIPOW I FFPOW) These routines are called by FORTRAN to implement exponentiation. The address of the first operand is in the AC (floating-point or processor depending on mode), and the address of the second is an argument. The address of the result is in the appropriate AC upon return. Function Name Mode of Operand l (Base) Mode of Operand 2 (Exponent) Mode of Result II POW Integer Integer Floating point Floating point Integer Floating point Integei Floating point Integer Floating point Floating point Floating point IFPOW FIPOW FFPOW CALL ARG E.7 2,FFPOW addr 2 /ADDRESS OF OPERAND 2 LIBRARY ORGANIZATION Part l. 11 IOH 11 FLOAT 11 contains contains INTEGER 11 UTILITY 11 11 ERROR11 contains contains contains IOH I READ I WRITE FAD I FSB I FMP I FDV I STO, FLOT, FLOAT, FIX, IFIX, IFAD, ISTO, CHS, CLEAR IREM, ABS, IABS, DIV, MPV, IRDSW TTYIN, TTYOUT, HSIN, HSOUT, OPEN, CKIO SETERR, CLRERR, ERROR 11 contains contains contains contains contains SUBSC IIPOW, IFPOW I FIPOW, FFPOW I EXP I ALOG SQRT SIN, COS, TAN ATAN 11 11 11 Part 2. SUBSC 11 POWERS 11 11 SQRT 11 11 TRIG 11 11 ATAN 11 11 E-5 E .8 DECTAPE I/O ROUTINES RTAPE and WTAPE (read tape and write tape) are the DECtape read and write subprograms for the 8K FORTRAN and 8K SABR systems. The subprograms are furnished on one relocatable binarycoded paper tape which must be loaded into field 0 by the 8K Linking Loader, where they occupy one page of core. RTAPE and WTAPE allow the user to read and write any amount of core-image data onto DECtape in absolute, non-file-structured data blocks. tv\any such data blocks may be stored on a single tape, and a block may be from 1 to 4096 words in length. RTAPE and WTAPE are subprograms which may be called with standard, explicit CALL statements in any 8K FORTRAN or SABR program. Each subprogram requires four arguments separated by commas. The arguments are the same for both subprograms and are formatted in the same manner. They specify the following: a. DECtape unit number (from 0 to 7). b. Number of the DECtape block at which transfer is to start. The user may direct the DECtape service routine to begin searching for the specified block in the forward direction rather than the usual backward direction by making this argument the two's complement of the block number. c. Number of words to be transferred (1 < N < 4096). d. Core address at which the transfer is to start. In 8K FORTRAN, the CALL statements to RTAPE and WTAPE are written in the following format (arguments are taken as decimal numbers): CALL RTAPE (6, 128,388,LOCA) In 8K SABR, they are written in the following format (arguments may be either octal or decimal numbers): CALL 4, WTAPE ARG (6 ARG (200 ARG (604 ARG LOCB /WOULD BE SAME FOR RTAPE /DATA UNIT NUMBER /STARTING BLOCK NUMBER IN OCTAL /WORDS TO BE TRANSFERRED IN OCTAL /CORE ADDRESS, START OF TRANSFER In these examples, LOCA and LOCB may or may not be in COMMON. As a typical example of the use of RTAPE and WTAPE, assume that the user wants to store the four arrays A, B, C, and Don a tape with word lengths of 2000, 400, 400, and 20 respectively. Since PDP-8 DECtape is formatted with 1612 blocks (numbered 1-2700 octal) of 129 words each (for a total of 207,948 words), A, B,C, and D will require 16, 4, 4, and 1 blocks respectively. Each array must be stored beginning at the start of some DECtape block. The user may write these arrays on tape as follows: E-6 CALL WTAPE (O, 1,2000,A) CALL WTAPE (0,17,400,B) CALL WTAPE (O ,21 ,400 ,C) CALL WTAPE (O ,25 ,20 ,D) The user may also read or write a large array in sections by specifying only one DECtape block (129 words) at a time. For example, B could be read back into core as follows: CALL RTAPE (0, 17,258,B(l)) rA• ' RTAoi: (O I i 9 I 1 ?9 Bf?59)\I CALL RTAPE (O ,20, 13 ,B(388)) ""' ... ... I I I ... I I ..... ' ,..... As shown above, it is possible to read or write less than 129 words by starting at the beginning of a DECtape block. It is impossible, however, to read or write starting in the middle of a block. For example, the last 10 words of a DECtape block may not be read without reading the first 119 words as well. A DECtape read or write is normally initiated with a backward search for the desired block number. To save searching time, the user may request RT APE or WTAPE to start the block number search in the forward direction. This is done by specifying the negative of the block number. This should be used only if the number of the next block to be referenced is at least fourteen block numbers greater than the last block number used. For example, if the user has just read array A and now wants array D, he may write: CALL RTAPE (O, 1 ,2000 ,A) CALL RTAPE (0,-25,20,D) E. 9 DISK I/O ROUTINES (preliminary) ODISK and CDISK (open disk and close disk) and RDISK and WDISK (read disk and write disk) are the four DECdisk (DF32/DS32) input and output subprograms for the 8K FORTRAN and 8K SABR systems. They are furnished on one relocatable binary-coded paper tape which is loaded into core using the Linking Loader, where they occupy eight pages of core. E.9.1 ODISK and CDISK ODISK is used to open (activate) a file (named using the Linking Loader D function) so that the file can be read or written using RDISK or WDISK. CDISK will close (deactivate) a file which was opened with ODISK so that the contents of the file cannot be altered. The ODISK and CDISK subprograms may be called with standard, explicit CALL statements, in any 8K FORTRAN or 8K SABR program. ODISK requires one argument when opening a file. However, it requires two arguments when specifying or changing the size (in blocks) of a file. CDISK always requires only one argument. E-7 The first argument of both ODISK and CDISK is the logical number (from 1 through 10 inclusive} of the file as it was named using the Linking Loader. (Refer to Section H .3 .1 for a discussion of logical file numbers.) The second argument to ODISK is the number of blocks (from 1 through 128) to be saved for the fi Ie • In 8K FORTRAN, the CALL statements to ODISK and CDISK are written in the following format (arguments must be decimal integer numbers}: CALL ODISK (1) when opening a file, or CALL OD ISK (l ,5} when specifying or changing the size of a fi I e, and CALL CDISK (1) when closing an opened file. In 8K SABR, the CALL statements to ODISK and CDISK are written in the following format (arguments may be either octal or decimal numbers}: CALL 1, ODISK ARG (1 ARG (5 /LOGICAL FILE NUMBER /NUMBER OF BLOCKS, OCTAL when specifying or changing the size of a file, and CALL 1 ,CDISK ARG (1 /LOGICAL FILE NUMBER when closing an opened file. ODISK prepares the file named for data transfer. When running the user program using the Disk Monitor System, ODISK uses Disk Monitor 1/0 and the three scratch blocks on disk zero for a window whenever a fi I e is opened . All open files should be closed before terminating program execution, thus preserving the contents of the files. E.9.2 RDISK and WDISK The RDISK and WDISK subprograms may be called with standard, explicit CALL statements in any BK FORTRAN or 8K SABR program. The ODISK subprogram must be used to open the file concerned before using the RDISK or WDISK subprograms. E-8 Each of these subprograms requires four arguments, arranged as listed below: 1. Logical file number (determined using the Linking Loader D function). ') ~. Logical block of the file number (block number of the file where data transfer is to 3. Number of words to be transferred (from 1 through 4096) 4. Core address where data transfer is to start (field O) • begin), Both RDISK and WDISK require the arguments above. !n 8K FORTRAN, the CALL statements to RDISK and WDISK are written in the fol !owing format (arguments are taken as decimal numbers): CALL RD ISK (4 ,2 ,55, LOCA) when reading file 4, beginning with block 2, transferring 55 words, starting at the location of tag LOCA, which may be the name of an array defined in a DIMENSION statement. WDISK would be formatted in the same fashion. In 8K SABR, the CALL statements to RDISK and WDISK are written in the fol lowing format (arguments may be either octal or decimal numbers): CALL 4, RDISK ARG (4 ARG (2 ARG (55 ARG LOCA /SAME FOR WD IS K /LOGICAL FILE NUMBER /BLOCK 0 F FILE /WO RDS TO TRANSFER, OCTAL /CORE ADDRESS OF START, FIELD 0 WDISK would be formatted in the same fashion. A variable number of words may be transferred. It is not necessary to transfer in 200-word blocks, as with the Disk /v\onitor System. E-9 APPENDIX F SAMPLE OF AN ASSEMBLY LISTING This program is offered only to i I lustrate many of the features and formats of a SABR program. The program cannot be run. PDP-8 SABR DEC-08-A2B2 High Speed Reader ? Y High Speed Punch? Y Listing on High Speed Punch? DTCA DTSF LOC MUL NAME POINTR SUB St St2 S2 S3 S4 TAG x y z N 67620P 67710P OOOOUNDF OOOOEXT lOOOCOM 1013 0200EXT 0202 0214 0214 0227 0233 0177ABS 0400 0401 0402 /SAMPLE OF SABR CODE 6762 6771 0200 0201 0202 0203 0204 0205 0206 0207 0210 0177 OP DEF SKPDF /ABSYM ABSYM 200 NAME, 0000 0000 0000 4067 0200 01 1407 7106 7006 6211 DTCA DTSF LOC TAG DECIM COMMN ENTRY DUMMY LAP BLOCK SUB, st/ F-1 6762 6771 176 177 8 SUB x 2 EAP OCTAL 0 TAD I SUB CLL RTL; RTL DCA NAME# 0211 0212 0213 3776 6201 05 2775 0214 0215 0216 0217 0220 0221 0222 0223 0224 4033 0302 06 6201 05 0400 01 6201 05 0374 01 6201 7777 1373 st 2, S2, INC POINTR CALL 3,MUL ARG x ARG (20 ARG -1 TAD (D-49 LOC, 1 IF 0225 0226 1372 5200 0227 0230 0231 0232 0233 0234 S3, 0372 0373 0374 0375 0376 0377 4233 0004 0200 0371 01 6762 5377 0037 7501 7717 0020 1013 01 1001 7000 0400 0401 0402 0403 0404 0405 0406 0407 0410 0000 0214 01 2301 1520 0075 4052 5777 6465 6600 x, 0411 U/ I 0412 0413 0576 0577 5376 5377 7410 7410 1000 1001 1002 1003 1004 7410 7410 5206 4062 0214 01 0371 PAUSE TAD JMP CPAGE JMS 4 NAME (37 DTCA S4, PAGE 0 St2 TEXT Y, Z, L. 771 (-"? SUB 4 S4 "SAMP @ = */?456 DTSF I REORG SKP TAD I F-2 1000 St2 II 1005 1006 1007 1010 1011 1012 1013 1176 1177 1407 1377 6211 3776 4040 0001 06 0000 1000 0333 POINTR, TAD DCA (333 NAME RETRN SUB 0 END For a multiple word instruction the actual instruction line is typed beside the first instruction. 0650 0651 0652 0653 0654 6201 5774 7106 7006 7006 05 LOC2, JMP NAME /OFF PAGE CLL RTL; RTL; RTL For an erroneous instruction, the error flag appears in the address field. The instruction is not assembled. 0700 7200 0701 7402 N2, CLA CLL SKP HLT The page escape and literal and off-page pointer table are typed with nothing except the correct address, value and loader code. 0770 0771 F. 1 7006 7500 0772 5376 0773 0774 0775 0776 0777 5377 0200 01 0020 7410 7410 N3, RTL SMA THE SYMBOL TABLE Symbols are listed in alphabetic order at the end of the assembly pass (Pass 1) with their relative addresses beside them. The following flags are added to special types of symbols. ABS COM OP The address is absolute. The address is in COMMON. The symbol is an operator. F-3 EXT UNDF The symbol is an external and thus, may or may not be defined. If not defined there is no difficulty; it is in another program. The symbol is not an external symbol and has not been defined in the program. This is a programmer error. No earlier diagnostic can be given because it is not known unti I the end of Pass 1 that the symbol is undefined. A location is reserved for the instruction containing the undefined symbol, but nothing is placed in it. F-4 APPENDIX G OPERATING PROCEDURES This appendix is a condensation of Chapter 4. The figures referenced (in parentheses) are found in the PDP-8/I System User's Guide, DEC=08=NGCC-D. G. l LOADING THE SABR ASSEMBLER Procedure Load the SABR Assembler using BIN (See Figure B-2); IF= 1 SR== 7777. When loaded, parts of the Assembler wi 11 be in field 0 and field 1. To load the Assembler on the disk, proceed in step sequence, otherwise, begin at step 4, below. 2 With the Disk Monitor in memory, cal I the Disk System Loader by typing: .LOAD and load the SABR assembler onto the disk (see PDP-8/I Disk/DECtape Monitor System, DEC-D8-SDAB-D). 3 Save the Assembler by typing: .SAVE SABR!0-7177; 200 .SAVE SABl !~, 1700 - 12427;) 1t)e G.2 ASSEMBLING (Pass 1) See section 4.4 for alternate methods of assembling. Procedure Step 4 Insert source program tape into the tape reader. 5 Set DF==O, IF==O, SR==0200, press LOAD ADD, START, and answer SABR's initial dialogue. 6 Turn the appropriate punch and reader ON; the tape reads in and the binary tape is punched. 7 If the program is in sections, when a PAUSE is encountered, insert the next section of tape into the tape reader and press CONT; assembly is completed when SABR halts after producing the relocatable binary tape. SABR may be restarted to assemble another program by starting over at step 4 above • SABR may be restarted at any time by pressing STOP and starting over at step 4. G-1 ~ ;.J.z.if 171.~31)/~' Procedure To generate an assembly listing, proceed in step sequence, otherwise, begin at step 9. 8 G .3 Insert the source program tape(s) into the reader and press CONT. LOADING THE LINKING LOADER Procedure Set DF=highest field in the configuration, IF= 1, SR=7777, and press LOAD ADD. G .4 10 Insert Linking Loader tape into the appropriate reader: if ASR reader, turn reader ON; if high-speed reader, set SR=3777. 11 Press START; the Linking Loader will be read into core memory. LOADING PROGRAMS AND SUBPROGRAMS Step Procedure i2 Set DF and IF=to DF in step 9 above, SR=0200, and press LOAD ADD. 13 Insert relocatable binary tape (first, program or subprogram with largest amount of COMMON storage) into the reader with Ieader code over reader head • 14 Set SR as explained in Section 5 .5. 15 Press START; the relocatable binary program wil I be Ioaded into core memory • Repeat from step 13 for subsequent program or subprogram tapes ~select an option (core availability or storage map) as explained in Section 5.3. G .5 EXECUTING THE SABR PROGRAM Step Procedure 25 Set DF and IF=to field of MAIN program, and SR=to starting address of MAIN program (determined from storage map) • 26 Turn punch ON and/or insert data tape in reader, as required. 27 Press LOAD ADD and ST ART. Program execution will begin. G-2 APPENDIX H DISK LINKING LOADER H. l INTRODUCTION The Disk Linking Loader (LLDR) is used to load and execute 8K FORTRAN compiled and 8K SABR assembled user programs when the system configuration includes one or more DECdisks and the Disk Monitoi System. Such user progrnms exist as a main program with several subprograms (including necessary 8K library subprograms), all of which must be on punched paper tape in relocatable binary format. LLDR loads these multiple-part programs in a page-wise relocatable manner, and links all calls to and returns from external subprograms. The user communicates with LLDR via the keyboard in a simple, straightforward manner; LLDR types *OPT - and the user responds with a one-letter code which causes LLDR to perform one of seven possible functions (operations). LLDR, unlike the standard BK Linking Loader (Chapter 5), is entirely keyboard oriented and makes extensive use of the disk. For example: a. It allows user programs to be loaded over LLDR itself by utilizing temporary disk storage in the Disk Monitor System environment. b. it provides two ievels of program overlaying so that much larger programs can be run. Up to eight files (programs and subprograms) can be loaded into each overlay area. Overlay files are saved on the disk and called into core as needed at program execution time. c. It provides several utility and convenience features such as storage map listing, a listing of necessary subprograms not present in core, a listing of available (unoccupied) core, and automatic program starting . d. It includes load-time monitoring via the keyboard rather than the console switches, and several other minor features. LLDR accepts paper tape input only, from either the low- or high-speed readers, as do both the 8K FORTRAN and BK SABR systems. However, the user program (during execution) can use both DECdisk and DECtape for input/output. The operating system (Run-Time Linkage Routines) necessary for execution of BK FORTRAN and BK SABR programs is contained within the LLDR program, and its use is entirely automatic. Two loading techniques are provided: normal loading and overlay loading. In normal loading, each file is loaded into a separate core area where it remains during execution. In overlay loading, several files are sequentially loaded into the same core area and saved on the disk. At execution time, each file is brought from the disk into core when it is needed. LLDR provides two levels of overlay, and each al lows up to eight files per overlay level. A normally loaded program may call a program in either overlay level, and a program in either overlay level may cal I a program in the other level. H-1 The fol lowing main stipulations should be remembered when using LLDR. a. A program in an overlay level may not call another external program in the same overlay level, except as explained in Section H .4. b. Common storage (i.e., data storage accessible by al I programs and subprograms) is always located in field l. c. The program or subprogram which requests the largest amount of common storage must be loaded first. d. No one program or subprogram may be greater than 4K in length. e. Programs may not be loaded across field boundaries, although they may be loaded into any available field. f. Overlay files may not be loaded over LLDR, although normal files may be. LLDR requires a PDP-8/I, -8/L, -8, or -8/S computer with at least 8K words of core, an ASR-33 Teleprinter, and at least one DECdisk. A high-speed paper tape reader is optional but highly recommended. LLDR can use al I avai Iable core memory and disk storage. H .2 LOADING, SAVING, AND STARTING LLDR LLDR is furnished on punched paper tape in binary-coded format, and is loaded into field 0 by the standard Binary Loader (refer to PDP-8/I System User's Guide, DEC-08-NGCC-D). Before using LLDR or saving it as a systems program on the disk, it should be properly initialized for the amount of core available and for the type of paper tape reader to be used. LLDR is initially set for a basic configuration of SK words of core and a high-speed paper tape reader. With any other configuration, LLDR should be started and initialized as explained in Section H .2 .2. Complete loading, saving, and cal ling procedures are given below for both basic and expanded configurations. The following procedures assume that the user is familiar with the Disk N\onitor System, and that the system is avai Iable for use. H .2 .1 Basic Configuration The user with SK of core and a high-speed reader should use the following procedures. a. Determine that the Disk l\.A.onitor is in memory. (Type CTRL/C* or START at 07600 .) b. When N\onitor responds with a dot, call the system loader by typing .LOAD) ( ) represents typing the RETURN key) *CTRL/C is typed by holding down the CTRL key while typing the C key. H-2 c. Insert the LLDR binary tape in the high-speed reader. d. Answer the loading command dialogue as follows: *IN-R: ) * *ST= ) t <CTRL/P> t <CTRL/P> Keys shown within angle brackets are not echoed on the teleprinter when typed by the user. After each up-arrow which is typed by the Monitor, the user types CTRL/P by holding down the CTRL key while typing the P key; this is equivalent to pressing the CONT switch when loading manually. e. LLDR is now loaded into core; save it on the disk by typing ..:.SAVE LLDR!0-6777;200) f. LLDR may now be called to load relocatable binary programs by typing .LLDR ~ H.2.2 Expanded Configuration The user, with any configuration other than the basic configuration mentioned above, should use the fol lowing procedure: a. Determine that the Disk Monitor is in memory. (Type CTRL/C or START at 07600 .) b. When Monitor responds with a dot, call the system loader by typing .:.LOAD) c. Insert the LLDR binary tape in the appropriate reader. d. Answer the loading command dialogue as fol lows: *IN-R: ~ -*- (R: T: for high-speed reader for ASR reader) *ST=7400) _! <CTRL/P > t <CTRL/P > e. LLDR is now loaded into core. It automatically starts at location 7400, causing it to type out its initialization questions. Answer the questions as shown below. *GIVE SIZE OF MEMORY IN K-12) (user typed 12) *HIGH SPEED READER? Y (user typed Y) When answering the first question, the user should type the amount of available core memory after K-; the user should type Y for yes, or N for no in answer to the second. f. When the above questions have been properly answered, LLDR may be saved on the disk by typing .SAVE LLDR!0-6777;200 ~ g. LLDR may now be called to load relocatable binary programs by typing .LLDR) H-3 whereas the LLDR system program wil I be transferred from disk storage into core memory, and automatically started (executed) so that it types out its version number and *OPT-. It then waits for the user to specify which of the seven optional functions is to be performed. The version number and option request might appear as shown below. PDP-8 DISK w LINKING w LOADER w DEC-08-A2C7-03 *OPTLLD R is now in core, started, and ready for use . H .3 LLDR Functions When LLDR has been initialized and started as described in the preceding section, it types its program version number (also found on the paper tape identification label) and option statement and then waits for the user to specify the desired function to be performed. For example: PDP-8 DEC-08-A2B4-02 *OPTThe user's response to *OPT- is in the form of a one-letter code fol lowed by the RETURN key. LLDR's functions and corresponding one-letter function codes are listed below. Code Function c Core avai labi Iity listing D Disk file assignment E Exit with halt L Normal loading M Storage map Iisting 0 Overlay loading s u Start main program Un loaded program Ii sting Functions may be cal led whenever needed or desired, except that the M, U, and S functions must not be cal led first. Upon completion of a function (except E or S), LLDR will request another by repeating the option statement (*OPT-). Any error made by the user when responding to an option statement will cause LLDR to type a question mark, ignore the response, and repeat the option statement. LLDR may be stopped (e.g., to make a program patch) and restarted without altering the state of the computer by using the console STOP switch and restarting at 00600. This method may be used at any time after completion of any function other than D, except during overlay loading or wh i Ie a tape is actual Iy being read . H-4 At any time during the use of LLDR (except while a tape is being read in), control may be returned to the Disk Monitor. This is done by typing CTRL/C; however, when CTRL/C is typed, all data temporarily stored on the disk is lost. H .3 .1 Disk File Assignment Function (D) If the user's programs or subprograms create or use disk data files with the RDISK and WDISK library functions, the D function must be the first function used. The D function performs the preliminary job of entering the names of user files into the disk directory. This prepares the way for using the RDISK and WDISK iibrary functions, which aiiow the user to read and write data on the disk at execution ti me. Use of the D-function proceeds as shown below: PDP-8 DEC-08-A2B4-0l *OPT-D ) *FILES-ABC, WXYZ, Ml I /\Kl., 5H, R, 3, p) *OPTwhere a directory entry is assigned to each of the eight fi!e names. File names may be from one to four characters in length, and up to ten files may be specified. All such files must be named in one execution of the D function. The order in which the data files are named for the D function is especially important. The reason for this is that when the user's program references disk data files using the RDISK and WDISK library functions, he must reference these files not by name but by logical number (1,2, ... , 10). This logical number is determined by the order in which he names the files for the D function. For example, if files have been named in the D function as shown in the previous example, the user's program wi 11 reference fi Ie M1 by statements of the form CALL RDISK (3 I •••) because M 1 was the third fi Ie named. Before using the D function the user should study thoroughly the operation and use of the RDISK and WDISK I ibrary functions in Section E-9. The disk directory will accommodate ten file names. If the directory is too full to accommodate al I files named, a meaningful error message is printed by LLD R. In the example above, if the directory had room for only four files, the error message DISK WILL NOT HOLD 5H & FOLLOWING FILES would have been printed. If this happens, the entire D function request is ignored and LLDR prints another *OPT- to allow the user to repeat the D function with fewer files or to specify a different function. H-5 After the D function has been performed, LLDR will again print *OPT- for the user to continue with the process of loading his program. After the D function has been used or when a different function has been called, the D function is no longer available--if called a second time or after a different function, it is treated as an illegal function code. Again, if the D function is to be used, it must be the first function used. If it is not chosen as the first function, it is not available for use until a fresh image of LLDR is brought into core from the disk. H.3.2 Loading Functions (L and O) The two loading functions, L for normal loading and 0 for overlay loading, are avai Iable for use at any time. These are the principal functions of LLDR--to load relocatable programs for execution. These functions use the standard technique of link-loading as described in Chapter 5, which applies specifically to the relocatable binary code (Chapter 3) produced by the 8K FORTRAN/SABR system. Programs and subprograms may be loaded in any order and into any field. The only restrictions are listed below. a. The subprogram which requires the largest amount of common storage must be loaded first . b. No subprogram may be loaded across a core field boundary; i.e., no subprogram may be longer than 4K in length. c. A maximum of 64 subprograms may be loaded, including multiple entry points for single programs. LLDR loads subprograms in the order presented and into the field specified (see below) from the lowest available memory upward. Common storage is allocated in the lower portion of field 1 before loading actually starts. A maximum of 3840 words of common storage fills field 1. LLDR loads in a page-wise relocatable fashion (each program begins at the start of a new core page), establishing external links so that each subprogram is properly executed. H .3 .2. 1 Normal Loading (L) In normal loading, the user's program is loaded directly into core memory where it remains available for, throughout, and after execution. The core area occupied by each normally loaded program is the property of that program, and no other program can be loaded into its core area. To perform normal loading, the user responds to *OPT..___,,.,.. with the letter L. When this is done, LLDR types a request for the number of the field in which the user wishes to load. This specified field must exist in the configuration. For example: H-6 *OPT-L) *FIELD-2) Had field 2 been nonexistent, the fol !owing \Vou!d have occurred: *OPT-L) *FIELD-2) ? *OPTwhere LLDR ignored the user's response, typed the question mark, and repeated the option statement. When LLDR is satisfied with user response, it then types an up-arrow. At this point LLDR wi 11 pause and wait for the user to pi ace his reiocatabie binary tape in the tape reader, and to type CTRL/P which causes LLDR to load the program into core. When the program has been loaded, LLDR will type another up-arrow and pause for user response. If the user wishes to load another program into the same field, he need only place the tape in the reader and then type another CTRL/P (or press the CONTinue switch and then type CTRL/P is using the low-speed tape reader). When the user no longer wishes to load into the same field, he should respond to the up-arrrow by typing the RETURN key, and LLDR will type another option statement. The user may respond to an up-arrow with CTRL/N, which causes LLDR to by-pass the next program on a multi-program tape. This situation may, for example, occur with a library subprogram tape. A typical example of normal loading is shown below, where three programs are loaded into field 0 and two into field 1, with one program being by-passed. *OPT-L) *FIELD-0) *..!.<CTRL/P> _!_ <CTRL/P> l_ <CTRL/P> _!_) *OPT-L) *FIELD-1 ) * .!..<CTRL/P> t <CTRL/N > _!_ <CTRL/P> _! ) *OPT- If the low-speed reader had been used in the example above, the CONTinue switch would have been pressed just before each CTRL/key combination. H .3 .2 .2 Overlay Loading (O) Overlay loading allows the user to load as many as 16 subprograms into the same core area. The user may load one or two overlay levels (each 0 function cal I constitutes an overlay level) of subprograms (files) with up to eight files per level. Overlay loading is possible only when no two subprograms of the same level need to be in core at the same time, i.e., they do do not ca 11 each other. H-7 Al I subprograms loaded during the operation of an 0 function are loaded into the same core area (overlay level) and automatically saved in separate files on the disk. At execution time each file is called back into core as needed. No protection is given to the file of this overlay level that was previously in core. It is completely overwritten in core. Overlay files should use common storage for data which must remain in core. Files in a given level may be loaded in any order, provided they are all loaded during the same execution of 0 function. Files in a given level need not be the same length; enough core is allocated for the largest file in the level. Loading with the 0 function is quite similar to loading a string of programs in the same field using the L function. An example is given below, where three files are loaded into the first level and two files into the second level, with one file being passed over. *OPT-0) *FIELD-1 ~ :..! <CTRL/P >~ <CTRL/P > .! <CTRL/P >_!_ J *OPT-0) *FIELD-1) * t <CTRL/P >_!_ <CTRL/N >_! <CTRL/P >_! ) *OPTLoading of a single overlay level is terminated with the RETURN key. Loading of an overlay level wi 11 automatically be terminated after eight files have been loaded. As with the L function, if the low-speed reader had been used in the example above, the CONTinue switch would have been pressed just before each CTRL/key combination. When the main program is removed from core, linkage to its overlay files is broken. Therefore, for subsequent execution, files must be reloaded with the main program. H .3 .2 .3 Error Messages When LLDR detects an error during loading of a program, it types an error message of the fol lowing form: ERROR OOOn where n is a number from 1 to 6, representing the type of error detected. If the error is fatal, control returns to the Disk Monitor. If it is not fatal, the user may be able to continue loading (see below). Error Fatal? Attempt to load more than 64 subprograms Yes 2 Field overflow No 3 Subprogram with largest common assignment not loaded first Yes Error No. H-8 Error Error No. Fata!? 4 Checksum error No 5 Improper or damaged tape or reader error No 6 Disk overflow No A discussion of each non-fatal error is given below. Error 2 - During normal loading, loading may be continued in a different memory field. During overlay loading, the entire overlay level must be reloaded into a different memory field. Errors 4 and 5 - During either type of loading, the user may reposition the faulty tape in the wl/D1 ;••. . I. I.. espon .."' e I.. ea do ... r ,..,,....,..j ..... 1.... f.I y1no I'"'"' r-i ..... ;u.. r·"v t-h 11 e .... • 1ewI ut-' a •• ow . If the error persists , reassemb i y or hardware I ..... - .... maintenance wi 11 be necessary. Error 6 - Occurs during normal loading only when the user is loading into the upper portion of field O; the program which caused the error must be loaded into a different field. During overlay loading, the current overlay level will be closed with only the files that were loaded successfully. The file which caused the overflow (the last file read) and succeeding files will have to be loaded normally. H .3 .3 Uti Iity Functions (C, M, and U) H .3 .3 .1 Core Availability (C) The user may at any time request a list of the number of pages available for loading in each core field. The following example assumes that the user has a 16K computer (4 fields): *OPT-C ~ 0033 0036 0036 0036 *OPT-The numbers listed are the octal number of free pages left in fields 0, 1, 2, and 3, respectively. H . 3 .3 . 2 Storage Map (M) During the link-loading process, LLDR builds a list of external symbols; i.e., main program and subprogram entry points and their actual starting addresses. This list forms a complete storage map of all programs loaded, as shown below: H-9 *OPT-M) MAIN READ WRITE IOH SET ERR TTYIN 10200 01055 01066 03031 00000 00000 FLOAT FIX 05046 04513 u u *OPTStarting addresses are expressed in five octal digits - the first digit represents the memory field and the other four the address in that field. The U means that the stated subprogram has been called but has not been loaded, and therefore must be loaded before successful execution is possible. Listing of the storage map may be prematurely terminated by typing CTRL/P. H .3 .3 .3 Unloaded Program Listing (U) This function is used to obtain a list of those subprograms which must still be loaded before successful execution is possible. All symbols flagged with a U in a storage map listing will be listed as shown below: *OPT-U SET ERR TTYIN TTY OUT HSIN HSOUT *OPTThis listing may also be prematurely terminated by typing CTRL/P. H.3.4 Exit Functions (E and S) The E function is used to cause a halt after al I loading is complete. The S function is used to automatically start execution of the loaded program at the beginning of the main program. Both of these functions signal LLDR that loading is complete. They each cause any data which has been temporarily saved on the disk (except overlay files) to be read into core. When the E function is used, LLDR reads in al I data temporarily stored on the disk and then halts. The user's entire program (except overlay files) will be in core, ready for patching, execution, or saving on the disk. H-10 When the S function is used, LLDR checks for a subprogram called MAIN (such as a FORTRAN main program). If found, execution will automatically start at the starting address of MAIN. If MAIN is not found / the S function is executed as an E function. H .4 TECHNIQUES, OVERLAY LOAD ING In general, any group of subprograms which do not call each other (either directly or in- directly) may be loaded into the same overlay level. A typical situation fol lows: MAIN A B c D E,F,G,H contains calls to contains cal Is to contains cal Is to contains calls to contains calls to contain no external calls A, BI c I DI E ""' r Ll 1C1 r- r D,G DI E, H E The above combination may be loaded as fol lows: Normal Overlay 0 MAIN A D E B F Overlay 1 G H If D contains a call to any other than E, it would be better to load D normally and put E in overlay 1. If F were to call B, the above loading situation would not work; A would be calling B indirectly, and these two are in the same overlay level. It is possible, however, to call another program in the same overlay level only if the called program never attempts to return to the calling program. In this way, simple chaining may be achieved. For example, a very long FORTRAN main program can be split into sections with each section terminated by a cal I to the next. Such a situation is shown below. MAIN calls A, B, C and is terminated by a call to MAIN2 MAIN2 calls A, B, C and is terminated by a call to MAIN3 MAIN3 calls A, B, C and is terminated by a call to MAIN4 MAINS cal Is A, B, C and stops A, B,C contain no external calls The above combination may be loaded as fol lows: H-11 Overlay 0 Overlay l MAIN MAIN2 MAIN3 A B c MAINS When the MAIN program is contained in an overlay area, the E function cannot be used unless MAIN is loaded last into the overlay level. The S function wil I work with the above combination since it works regardless of the order in which the segments of MAIN are loaded. With FORTRAN programming alone, a subprogram other than a MAIN program may not be chained. However, this is possible with careful assembly language programming. An example of such programming is shown below, where SUB is split into a two-part chain, SUB and SUB2. MAIN is a standard FORTRAN program containing cal Is to SUB in the form: CALL SUB (A 1, A2, A3) SUB is written as a standard FORTRAN program which does part of the work for the entire subroutine chain, including processing arguments Al and A2. It is written with two arguments and concludes with CALL SUB2(Z where Z is any dummy argument. After SUB has been compiled and before the intermediate compiler symbolic is assembled, it should be edited to include the insertions enclosed in brackets. [X, SUB, COMMN2] ENTRY SUB BLOCK 2 TAD DCA TAD TAD DCA CALL ARG END SUB /SAVE RETURN FIELD x (-2 SUB# xu /-2* NO. OF ARGS TO BE PASSED /SAVE ARGUMENT ADDRESS l ,SUB2 z SUB2 is also a standard FORTRAN program containing the latter portion of the entire subroutine, including the processing of argument A3. The actual contents of SUB2 is coded in FORTRAN just as if it were a subroutine taking one argument. After SUB2 has been compiled, the compiler symbolic output is edited as shown below: H-12 COMMN 2] ENTRY SUB2 SUB2, BLOCK 2 rI TAD x SUB2 I DCA TAD SUB2# DCA /REPLACE ARG POINTER xH l l /CONTINUE WITH NORMAL FORTRAN /CODE, CONCLUDING WITH RETRN SUB2 END H .5 USER PROGRAM EXECUTION If the user chooses not to execute his program automatically with the S function, he may determine the exact address for the start (using the storage map or assembly listing), and execute his program, using the console switches or the Disk Monitor. At execution ti me, the Run-Ti me Linkage Routines (see Section 3 .3 .4) must be in core. These routines accomplish the necessary linkage for all calls to and returns from external subprograms, aii off-page indirect references, and all off-field references (including those to common and passing subroutine arguments). If 1 during execution of a user program, a call is made to a nonexistent program or subprogram, an unconditional halt wil I occur and control will return to the Disk Monitor. This error is fatal. All other execution-time errors are covered in Section C-3. Program execution may be terminated at any time by typing CTRL/C. However, when CTRL/C is typed, all overlay files stored on the disk are lost. H .6 STORAGE ALLOCATION The following core availability map allows the user to plan his loading. Field 0 0000-0777 Used by the Run-Time Linkage Routines and not available to the user for loading. 1000-4377 Avai Iable for any loading. 4000-7577 Residence of LLDR during loading. Available for normal loading (by automatic use of temporary disk storage), but not available for overlay loading. 7600-7777 Disk Monitor permanent residence. H-13 INDEX ABSY/v·\ Pseudo-Op 1-6; 2-4; B-2 Addresses, Program 3-8 Constants 1=8 ASCII 1-9 Alpha Constants 1-9 Illegal Alpha 1-9 Alphabetic Characters 1-2 Numeric 1-9 Alphanumerics 1-2, -6 Conversion, Numeric 1-10 ARG Pseudo-Op 2-11; B-2 Core Availability Option 5-2 ASCII Constants 1-9 CPAGE Pseudo-Op 2-2; B-2 Character Set App. A Data Generating 2-5, -6 Assembled Binary Code Ch. 3 DECIM Pseudo-Op 2-1; B-2 Assembly Demonstration Programs 6-1 Control 2-4 DUMMY Pseudo-Op 2-9; B-2 FORTRAN Pass 2 4-3, -4, -5 Listing 6-3, -4; F-1 , -4 Page 3-3 Variables 2-7 DUMSUB Linkage Routine 3-6 EAP Pseudo-Op 2-2; B-2 Pass l 4-2; G-1 Page Escapes 3-4 Automatic Paging Mode Elements / Statements 1-3 Enter 2-2 END Pseudo-Op 2-1; B-2 Leave 2-2 ENTRY Pseudo-Op 2-9; B-2 Binary Output, Relocatable 3-1 Error Messages App • C Blank Lines 1-5 Library Programs C-3 BLOCK Pseudo-Op 2-5; B-2 Linking Loader C-2 CALL Pseudo-Op 2-8; B-2 SABR C-1 CDF Current 3-2 Escapes, Page 3-4 CDFSKP Linkage Routine 3-5 Equivalent Symbols 1-6 CDZSKP Linkage Routine 3-6 Executing a SABR Program, Operating Character Set 1-2; App. A Procedures II legal 1-2 G-2 External, Subroutines 2-7, -8, -9 Codes, Loader Relocation 3-1, -2, -3 Flags, Symbol Table 1-8 Comments 1-4 Floating-Point Accumulator B-3; App. E COMMN Pseudo-Op 1-6; 2-4 FI oati ng- Point Arithmetic, Library Subprograms COMMON Storage 2-4, -7; 5-1 E-2 High 3-3 Format Effectors 1-5 INDEX (Cont) Format, Page 3-4 LAP Pseudo-Op 2- 2; B-2 FORTRAN Pass 2 Page Escapes 3-4 Assembly Methods 4-4, -5 Legal Characters 1-2 Operating Procedures 4-3, -4, -5 Library Subprograms App. E. FORTR Pseudo-Op 4-5; B-2 Error Messages C-3 Free Core, Page 0, D-1 Floating-Point Arithmetic E-2 FUNCTIONS, Library Subprograms E-4 Functions E-4 Hardware, Required Input/Output E-1 SABR 1-1 Integer Arithmetic E-3 Linking Loader 5-1 Organization E-5 IF Pseudo-Op 2-3; B-2 Powers E-5 Illegal Subscripting E-4 Alpha Constants 1-9 LINK Linkage Routine 3-7 Characters 1-2 Linking Loader Ch. 5 Incrementing Operands 1-7 Information Options 5-2 Input/Output, Library Subprograms· E-1 Error Messages C-2 Instructions Demonstration Of 6-4, -5 IOT 1-3 System Requirements 5-1 Memory Reference 1-3, B-1 Loading 5-1, -3 Skip 3-7 Memory Map Option 5-2 Micro (Group 1 and 2) 1-3; B-1, -2 Operation Of 5-3 Multiple Word 3-5 Sequence of 1-5 Integer Arithmetic, Library Subprograms E-3 Introduction Listing Symbol Table 1-8; F-1, -3, -4 Pass 2, Assembly 6-3; F-1, -2, -3 Literals 1-9, -10 SABR 1-1 Loader Relocation Codes 3-1 Linking Loader 5-1 Loading Procedures IOH Routines D-1; E-1 Information Options 5-2 IOT Instructions 1-3; B-2 Linking Loader 5-1; G-2 Labels Programs and Subprograms G-2 Example Of 1-3 Language, SABR Ch. 1 SABR: Basic 4-1; G-1 Disk Monitor 4-1 INDEX (Cont) Pass 2, Listing 4-2 Memory Map Option, Linking Loader 5-2 FORTRAN 4-3 -4, -5 Memory Reference Instructions 1-3; B-1 Methods, FORTRAN Pass 2 Assembly 4-4, -5 PAUSE, Pseudo-Op 2-1; B-3 Microinstructions (Group 1 and 2) 1-3; B-1 Permanent Symbols 1-6; App. B -2 Mode, Numeric Conversion 1-10 POWERS, Library Subprograms E-5 Multiple Word Instructions 3-5 Program Addresses 3-8 Nul I Lines 1--5 Programs, Loading Procedures G=2 Numeric Constants 1-9 Pseudo-Operators Numeric Conversion, Mode 1-10 Arguments To 1-4 OBISUB Linkage Routine 3-6 Description Of Ch. 2 OCTAL Pseudo-Op 2-1; B-2 List Of B-2, -3 OPDEF Pseudo-Op 1-6; 2-4; B-2 REORG Pseudo-Op 2-2; B-3 Operands 1-4 Relocatable Binary 3-1 Incrementing 1-7 Operating Procedures App. G Assemb Ii ng G~ 1 Requirements Hardware and Software 1- l Software 1= 1 Executing the SABR Program 4-2; G-2 RETRN Pseudo-Op 2-1 O; B-3 FORTRAN Pass 2, 4-3 -4, -5 RTN Linkage Routine 3-7 Loading Programs and Subprograms G-2 Run-Time Linkage Routines 3-5 Loading SABR G-2 SABR In Core 4-1 Error Messages C- 1 In Disk Monitor System 4-1 Language 1- 1 Operation, Linking Loader 5-3 Operating Prodecures Ch. 4 Operators 1-3 System Requirements 1-1; App. G Options, Switch Register 5-4 Sample of Assembly Listing App. F Core Availability 5-2 Sequence of Instructions 1-5 Storage Map 5-2 SKIP Instructions 3-7 Tape Reader 4-1; 5-3 SKPDF Pseudo-Op 1-6; 2-4; B-3 Page Assembly 3-3 Software Required Escapes 3-4 Linking Loader 5-1; App. G Format 3-4 SABR 1-1; App. G PAGE Pseudo-Op 2-2; B-2 Pass 1, Assembly 4-2 Special Characters 1-2 INDEX (Cont) Statements 1-2, -5 Text Pseudo- Op 2-6; B-3 Comments 1-4 User-Defined Symbols 1-6 Elements 1-3 Variables, DUMMY 2-7, -9 Format Of 1-3 Format Effectors 1-5 Labels 1-2 Operands 1-4 Operators 1-3 Storage, COMMON 2-7; 3-3; 5-1 Storage Map, Option 5-2 Subprogram Arguments, Picking Up 2-10 Subroutines, External 2-8, -10 Subscripting, Library Subprograms E-4 Switch Register Options 5-4 Core Availability 5-2 Storage Map 5-2 Tape Reader 4- 1; 5-3, -4 Symbolic Tape Editor 1-2; 6-1 Symbol Definition 2-4 Symbols 1-6, -7, -8 Equivalent 1-6 External Definition 3-2 Incrementing Operands 1-7 Permanent 1-6; B- 1 , -2, -3 Symbol Table Listing F-1, -3, -4 Types of 1-6 User-Defined 1-6 Symbol Table 3-8 Listing F-1, -3, -4 Special Flags 1-8 System Configuration SABR 1-1 Linking Loader 5-1 HOW TO OBTAIN SOFTWARE INFORMATION Announcements for new and revised software, as well as programming notes, software probiems, and documentation corrections are published by Software Information Service in the following newsletters. Digital Software News for the PDP-8 Family Digital Software News for the PDP-9/15 Family PDP-6/PDP- l 0 Software Bulletin These newsletters contain information applicable to software available from Digital's Program Library. Please complete the card below to place your name on the newsletter mailing list. Questions or problems concerning DEC Software should be reported to the Software Specialist at your nearest DEC regional or district sales office. In cases where no Software Specialist is available, please send a Software Trouble Report form with details of the problem to: Software Information Service Digital Equipment Corporation 146 Main Street, Bldg. 3-5 Maynard, Massachusetts 01754 These forms, which are available without charge from the Program Library, should be fully filled out and accompanied by teletype output as well as listings or tapes of the user program to facilitate a complete investigation. An answer will be sent to the individual and appropriate topics of general interest will be printed in the newsieiter. New and revised software and manuals, Software Trouble Report forms, and cumulative Software Manual Updates are available from the Program Library. When ordering, inciude the document number and a brief description of the program or manual requested. Revisions of programs and documents will be announced in the newsletters and a price list will be included twice yearly. Direct all inquiries and requests to: Program Library Digital Equipment Corporation 146 Main Street, Bldg. 3-5 Maynard, Massachusetts 017 54 Digital Equipment Computer Users Society (DECUS) maintains a user Library and publishes a catalog of programs as well as the DECUSCOPE magazine for its members and non-members who request it. For further information please write to: DECUS Digital Equipment Corporation 146 Main Street Maynard, Massachusetts 01754 Send Digital's software newsletters to: Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Company Name _ _ _ _ _ _ _ _ _ _ _ _ _ __ Address _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ___ (zip code) PDP-8/1 0 PDP-8/L 0 LINC-8 0 PDP-12 0 PDP-9 0 PDP-15 0 PDP-IO 0 OTHER 0 My system serial number is _ _ _ _ _ _ _ _ _ _ _ (if known) My computer is a Please specify ------- ·•·•········•············•······························································ Fold Here ....................................................................................... . ..•..............•...•..................................................... Do Not T car - Fold Here and Staple ················································ ............. . FiRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: mamanmn Digital Equipment Corporation Software Quality Control Building 12 146 Main Street Maynard, Mass. 01754 8K SABR READER'S COMMENTS DEC-08-ARXB-D Digital Equipment Corporation maintains a continuous effort to improve the quality and usefulness of its publications. To do this effectiveiy :ve need user feedback - your critical evaluation of this manual. Please comment on this manual's completeness, accuracy, organization, usability, and readability. DEC also strives to keep its customers informed of current DEC software and publications. Thus, the following periodically distributed publications are available upon request. Please check the appropriate boxes for a current issue of the publication(s) desired. 0 Software Manual Update, a qu·arterly collection of revisions to current software manuals. 0 User's Bookshelf, a bibliography of current software manuals. 0 Program Library Price List, a list of currently available software programs and manuals. Name - - - - - - - - - - - - - - - Organization S t r e e t - - - - - - - - - - - - - - Department City _ _ _ _ _ _ _ _ _ _ _ S t a t e - - - - - - - - - - - - - - Zip or Country _ _ _ __ ........................................................................................ Fold Here ........................................................................................ . ................................. ... ....................................... Do Not ·r car · Fold Here and Stapl·e ............................................................. .. FIRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: mamanma Digital Equipment Corporation Software Quality Control Building 12 146 Main Street Maynard, Mass. 01754 Digital Equipment Corporation Maynard, Massachusetts printed in U.S.A. ~nmnomo
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies