Digital PDFs
Documents
Guest
Register
Log In
DEC-08-CMAA-D
December 2000
78 pages
Original
1.9MB
view
download
Document:
MACRO-8
Programming Manual
Order Number:
DEC-08-CMAA-D
Revision:
Pages:
78
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/dec-08-cma/dec-08-cmaa-d.pdf
OCR Text
MACRO-8 - PROGRAMMING MANUAL PUP—8 DIGITAL EQUIPMENT CORPORATION . MAYNARD, MASSACHUSETTS PDP—8 PROGRAMMING MANUAL MACRO-8 For additional copies order No. DEC-08-CMAA—D from Program Library, Digital Equipment Price $2.00 Corporation, Maynard, Mass. DIGITAL EQUIPMENT CORPORATION O MAYNARD. MASSACHUSETTS ist Printing October 1965 2nd Printing Revised November I966 3rd Printing October 1967 4th Printing February 1969 Copyright©l965 by Digital Equipment Corporation 1966 1967 i969 instruction times, operating speeds and the like are included in this manual for reference only; they are not to be taken as specifications. The following are registered trademarks of Digital Equipment Corporation, Maynard, Massachusetts: DEC PDP FLIP CHIP FOCAL COMPUTER LAB DIGITAL PREFACE The PDP-8 comes to the user complete with an extensive selection of system programs and routines making the full data processing capability of the new computer immedi- ately available to each user, eliminating many commonly experienced initial programming delays. The PDP—8 programming system takes advantage of the many man-years of program development and field testing by PDP-5 users. Although in many cases PDP-8 programs originated as PDP-5 programs, all utility and functional program documentation is issued in a new, recursive format introduced with the PDP—8. Programs written by users of either the PDP—5 or the PDP-8 and submitted to the users' library (DECUS — Digital Equipment Corporation Users' Society) are immediately available to PDP-8 users. Con- sequently, users of either computer can take immediate advantage of the continuing program developments for the other. The MACRO-8 Manual is divided into two parts: Language. Basic Information and the MACRO Part 1 is especially for the new user, while those experienced with assembly programs will want to start with Part 2. iii CONTENTS PART I BASIC INFORMATION Chapter Page I INTRODUCTION 2 THE BINARY SYSTEM 3 THE PDP-8 INSTRUCTION SET Instructions ....................................................... ................................................... 3-] ........................................................ 3-] ................................... 3-I .......................................... 3-3 ......................................... 3-6 .............................................. 3-8 ...................................................... 3-9 Augmented Instructions The Organization of Memory Complement Arithmetic Addition Subtraction ORGANIZATION Coding .................................................... .................... . ................................. 3-9 4—1 ..................... 4-2 ......................................................... 4-4 ...................................... Comments 2—1 ........................................... Memory Reference Instructions 4 I-I Address Tags .................... Optimum Use Subroutines .................................. 4-5 ............................ 4-6 ................................................. 4—6 Symbolic Addressing Storage Techniques . . ............... ...................... 4—7 ....................................... 4 -9 ...................... ................. . . . ........ . PART 2 THE MACRO LANGUAGE 5 MACRO-8 PROGRAMMING LANGUAGE Characters ....... . 5-2 ............................................... 5-5 . Integers ................ Symbols ........... Expressions 5-I ................................... ................ Elements ................................. . . . . . . . . .................................... .............. ............. . . . . . . . . . . . ...... ........ . 5—5 .................... 5-5 ..................... 5-7 . CONTENTS (continued) Chapter Page ........................................ 5—10 ................................................. 5—10 Current Address Indicator 5 (cont) Origin Setting Literals ....................................................... Single Character Text Facility 6 PSEUDO-INSTRUCTIONS Radix Control Numbers ............................................ 6-1 .................................................. 6-I ...................................................... 6-2 .......................................................... 6-2 Double Precision Integers ........................................ 6—2 ......................................... 6—3 ...................................................... 6—3 ..................................................... 6—4 ....................................................... 6-4 Floating Point Constants Text Facility End of Program End of Tape Alterations to the Symbol Table MACROS 5-12 ............................................... Current Location Counter Extended Memory ................................... 5-11 ............... Restrictions . ...................................... ............................................. ........................................................ ERROR DIAGNOSTICS Error Messages .................................................. ..................................................... OPERATING INSTRUCTIONS ............................................ Symbol Table Modification .......................................... Appendix MACRO-8 SYMBOL TABLE ASCII CHARACTER SET .............................................. ................................................. vi 6-4 HLUSTRNHONS Memory Reference Instruction Format IOT Instruction Format ...................................... .................................................. Group I Operate Microinstruction Format .................................. Group 2 Operate Microinstruction Format .................................. Flow Chart of Program to Calculate Sum of Integers Program Example .................. . ...... ....................................................... TABLES Table 2-I First Sixteen Integers in Three Number Systems 3-I Memory Reference Instructions 3-2 Group I Operating Microinstructions ...................................... 3-3 Group 2 Operating Microinstructions ...................................... 3-4 Effective Address Calculation 3-5 One's and Two's Complement Representations 9-] Switch Options ............................. 2—] ........................................... 3-2 ............................................ ............................... ............................. VII . ........................... 3—4 3—6 3—7 3-8 9—2 PART 1 BASIC INFORMATION CHAPTER 1 INTRODUCTION In describing the solution of the Following equation, y=mx+b one can say, "First, multiply the quantity x by m. To this product, add the quantity b. The result is the value of y." The same problem can be solved on an adding machine in the following steps: l . Clear the keyboard and registers. 2. Enter the value of m and press the ADD key. 3. Enter the value of x and press the keys which initiate the multiplication. 4. Enter the value of b and press the ADD key. The result, appearing in the totalizing register, is the value of y. This sequence of steps can be thought of as a program for the solution of the problem on an adding machine. in similar fashion, the steps can be written out for a solution to be performed by a digital computer. in- stead of pressing buttons and keys, the programmer writes a sequence of instructions to perform operations on data stored in the computer. Such a sequence (for a hypothetical computer) might appear as follows: clear add m multiply x add b deposit y The variables m, x, and b represent quantities stored in the computer; the variable y represents a storage register. The operations are carried out in a register called the accumulator, abbreviated AC. instruction clears the AC. The next adds the quantity m into the AC. The third instruction multiplies the contents of the AC by the quantity x, and the fourth adds the quantity b to the result. contents of the AC are deposited into a storage The first Finally, the register designated by the symbol y. To be useful to a computer, the instructions of a written program must be translated into a sequence of numeric codes, each of which represents a specific computer operation. 1-] To do such translating by hand from instructions to binary numbers would be tedious and lengthy. to perform the translating task, Computer programs have been written interpreting the written program and producing from it a second program which can be executed directly by the computer. These translators are called assemblers because they assemble from a source program written by the user, a working program instruction by instruction. This output from the assembler is called an object, or binary program. MACRO-8 is an assembler designed to accept input in the form of a sequence of symbolic instructions representing the operations capable of being executed on the PDP-8. which may then be placed in the computer and executed. It produces a binary program tape The next chapter explains a few basics of the binary numbering system; succeeding chapters deal in more detail with the MACRO—8 assembly program. 1-2 CHAPTER THE BINARY 2 SYSTEM Every item of information stored in or processed by a digital computer is encoded as a binary number. Consequently, the user should become familiar with the binary system and be able to convert numbers from binary to decimal representation and back, as using the octal system as an intermediate. Eventually, the programmer gains more experience, he will find himself using the decimal system less and "thinking in octal" more. This is a useful habit to cultivate. Table 2—1 gives the first 16 integers (and 0) as they are represented in the decimal, binary, and octal number systems. Note that in the decimal system there are ten different symbols, or digits, 0—9 which are In the binary system there are two, 0 and 1; in the octal system, eight, The number of digits required in a given system is called the radix. Therefore, the decimal radix used to represent any number. 0-7. is 10; the octal radix is 8, and the binary radix is 2. A subscript is used to identify the radix of the sys- tem in which the number is represented. and a 1101012 Thus, 4-19610 indicates a decimal number, 25478 an octal number, binary number. TABLE 2-1 FIRST SIXTEEN INTEGERS IN THREE NUMBER SYSTEMS Octal Binary 9 11 1001 10 12 1010 13 14 1011 1100 Decimal Decimal Octal 0 0 000 1 1 2 2 001 010 11 3 3 011 12 Binary 4 4 100 13 15 1101 5 5 101 14 16 1110 6 6 110 15 17 1111 7 7 111 16 20 10000 8 10 1000 All numbering systems using radices involve positional notation; that is, each successive digit position to the left represents the next higher power of the radix. For example, the decimal number expressed algebraically as 4x103+1x102+9x10l +6x 100 2—1 419610 may be which when calculated becomes 4x 1000+lx100+9x 10+6x l =4l9610. Positionally, this appears as 102 TO] TOO 1000 100 10 i (Radix to its respective powers) 4 i 9 6 (Units required of each value) 103 (Positioned radix) Likewise, the octal number 25478 can be expressed as 2 x 83 + 5 x 82 + 4 x 81 + 7 x 80. In all systems the integral and fractional parts of a number are separated by a radix point. Depending on the system in use, this may be a decimal point, octal point, or binary point. As can be seen from the table, four binary digit positions are required to represent the decimal integers The octal integers up to 7 require only three binary positions; furthermore, exactly three positions up to 9. are needed. octal digits. In other words, three binary digit positions are necessary and sufficient to represent the eight This fact makes binary-to-octal and octal—to-binary conversions quite simple. Example: Binary-to-Octal Conversion The binary integer 1011100110102 can be converted to its octal equivalent as follows: i . Divide the binary digits into groups of three, starting from the right 101 110 011010 2. Substitute for each group its octal equivalent 5 3. 6 3 2 The result is the octal number 56328 To perform the reverse conversion, substitute the binary equivalent of each octal digit 4 7 5 1 47518 =iOOiii 101001 =1001111010012 2-2 To convert an octal fraction, group by threes in each direction away from the radix point 1110101 .0100012 =1 HO 101 2243.5578 =010010 100011 010 01(0) . =1c’>5.228 101 101 iii . =010010100011.1011011112 Example: Decimal-to-Binary Conversion The "remainder method" may be used to convert a decimal number to a binary number. The decimal number may be converted as Follows: NNM 2 (binary radix)—92 Odo—doflaflofl \lmfl-PN-d—'01NO~OJ-—' N N w—Iat sis-IAN CO N \l O O +— (remainders) b 1011100110102 Notice that this method simply involves halving the number to be converted and noting the remainder after each division. Example: Decimal-to-Octal Conversion The remainder method may also be used for octal conversions. The decimal number 297010 would be converted as follows: 0 8 T— O~U1 8 T4— 8 (octal radix)—D8 37] 2970 _- 0 NQJO~UI ’x 4-- (remainders) 56328 ln one sense, the conversion of a number from one representation to another is a way of encoding the number; the octal integer 778 can be encoded as the binary integer llllll a binary code to any symbol, such as a letter of the alphabet. . Similarly, one can assign The table in Appendix B shows the binary codes assigned to all the characters of the Model ASR-33 Teletypewriter. A programmer may invent a symbolic name to refer to the location of a given word in the computer mem- These symbolic names, or tags, are assembled together with the instruction mnemonic into a binary ory. number which indicates the memory location of the word, the instruction code, and the address of the data . The association of binary code and symbol is the basis of a programming language. A programmer learns the symbols for the computer's repertoire of operations and the rules for arranging a sequence of symbolic instructions in a useful format. paper tape. An assembly program accepts this source program input and translates it into an equivalent sequence of binary numbers, on an He prepares a symbolic program for input on a medium such as punched producing a program which is usable directly by the computer by placing it output medium, which again may be punched tape. be read into the computer and executed. 2-4 This binary, or object program tape may then CHAPTER THE PDP-8 3 INSTRUCTION SET INSTRUCTIONS Every PDP—8 operation is specified by a unique combination of 1's and 0's stored in the twelve bits of one memory register. Such an instruction word can be one of two types: memory reference instructions per- form operations which require access to the information stored in a memory register; augmented instructions do not refer to memory cells. The operation code of an instruction is contained in bits 0, l, and 2 of the word. Since three binary digits correspond to one octal digit, it is apparent that there can be no more than eight operation codes, corresponding to the octal digits 0-7. Codes 0—5 are reserved for memory reference instructions. codes 6 and 7 are for augmented instructions. Operation These two types of instructions are defined, and the instruc- tions described, in the following sections. The following special symbols are used in the instruction lists below. Definition M C(A) The contents of register A C(A) % C(B) The contents of register A replace the contents of register B Y The address or location of any memory register Yl The ith bit of register Y Y]_4 Bits l—4, inclusive, of register Y C(AO-S) => C(Yé—l 1) The contents of bits 0—5 of register A replace the contents of bits 6-H of register Y. not affected The contents of A are . V Inclusive OR A AND CiAl The l's complement of the contents of register A (Boolean) Memory Reference Instructions Word format of memory reference instructions is shown in Figure 3—1 , and the instructions are explained in Table 3-l . OPERATION CODES 0—5 MEMORY PAGE r—*—fi 0 1 2 4 3 L..Y_J 5 6 7 TABLE 3-I Mnemonic Octal Time Symbol Code (pseC) AND Y 3.0 9 10 H I \ v INDIRECT ADDRESSING Figure 3-i 8 ADDRESS Memory Reference Instruction Format MEMORY REFERENCE INSTRUCTIONS Operation Logical AND. The AND operation is performed between the C(Y) and the C(AC). The result is left in the AC, C(AC) are lost. The C(Y) are unchanged. Corresponding bits are compared independently. This instruction, often called extract or mask, can be considered => /\ as a bit—by—bit multiplication. and the original C(YI) C(ACI) C(ACI) Example C(ACI) original C(YI) final C(ACI) 0 —'OO I 0 I TAD Y 3.0 Two's complement add. The C(Y) are added to the C(AC) in 2's complement arithmetic The result is left in the AC . and the original C(AC) are lost. The C(Y) are unchanged. If there is a carry from AC0, the link is complemented. This feature is useful in multiple precision arithmetic . C(Y) + C(AC) => C(AC) [52 Y 3.0 Index and skip if zero. The C(Y) are incremented by one in 2's complement arithmetic. If the resultant C(Y) the next instruction is skipped. 0, If the resultant C(Y) )5 O, the program proceeds to the next instruction are = . The C(AC) unaffected. C(Y) + I => C(Y) If result 0, C(PC) + 1 => C(PC) = DCA Y 3.0 Deposit and clear AC. The C(AC) are deposited in core memory location Y and the AC is then cleared. The previous C(Y) are lost. C(AC) => C(Y), then 0 => C(AC) 3—2 TABLE 3-] MEMORY REFERENCE INSTRUCTIONS (continued) Mnemonic Octal Time Symbol Code (psec) JMS Y 4 3.0 0 pe r a f.Ion Jump to subroutine. ory location Y. Y + I The C(PC) are deposited in core mem— The next instruction is taken from location . C(PC) + I => C(Y) Y + 1 => C(PC) JMP Y 5 I .5 Jump to Y. The next instruction is taken from core mem— ory location Y. Y => C(PC) Augmented Instructions There are two classes of augmented instructions, or instructions which do not reference core memory. They are the input-output transfer (IOT) which has an operation code of 6, and the operate (CPR), which has an operation code of 7. Bits 3 through II within these instructions Function as an extension of the operation code and can be microprogrammed to perform several operations with one instruction. Augmented instructions are I-cycle instructions requiring I .5 psec for execution. Input-Output Transfer Instruction Microinstructions of the input—output transfer (IOT) instruction effect information transfers between the arithmetic and control element and an input-output device via the input-output control element. format of the IOT instruction is shown in Figure 3—2. The Bits 3 through 8 are used to select the I/O device; and bits 9 through II enable generation of I/O pulses during event times 4, 2, and I, respectively. Operations performed by IOT microinstructions are explained in Chapter 4 of the PDP—8 Users Handbook. GENERATES GENERATES AN IOP 4 AN IOP 1 PULSE AT EVENT TIME1 PULSE AT OPERATION EVENT TIME 3 IF A 1 Vr DEVICE SELECTION IF A 1 k—Vh" GENERATES AN IOP 2 PULSE AT EVENT TIME 2 IF A I Figure 3-2 IOT Instruction Format 3—3 Operate Instruction The operate instruction consists of two groups of microinstructions. Group I is principally for clear, complement, rotate, and increment operations and is designated by the presence of a O in bit 3. Group 2 is used principally for checking the contents of the accumulator and link and continuing to or skipping the next instruction based on the check. A l in bit 3 and a 0 in bit I] designate a Group 2 microinstruction. Group I operate microinstruction format is shown in Figure 3-3, and the microinstructions are listed in the table below. Any logical combination of bits within this group can be combined into one microinstruction. For example, it is possible to assign l's to bits 5, 6, and H; but it is not logical to assign l's to bit 8 and 9 simultaneously since they specify conflicting operations. If RAL, RAR, RTL, or RTR is specified, lAC may not be specified, and conversely. ROTATE 4 POSITION IF A 0. ROTATE OPERATION CODE 7 O | AC AND L 2 CLA CMA RIGHT 2 POSITIONS IF A t (—k‘fi r—N‘w r—A—x r—J—w 3 4 5 6 7 L_Y_..J \_W._J W CONTAINS A 0 TO SPECIFY CLL CML 8 9 10 41 kw._) H4 ROTATE IAC AC AND L LEFT GROUPI Figure 3-3 TABLE 3—2 Group I Operate Microinstruction Format GROUP 1 OPERATE MICROINSTRUCTIONS Mnemonic Octal Event Symbol Code Time CLA 7200 1 0 pera r‘Ion Clear AC. 0 => C(AC) CLL 7100 l Clear L . 0 => C(L) CMA 7040 l Complement AC. The C(AC) are set to the T's com— plement of C(AC). C(AC) => C(AC) CML 7020 l Complement L. C(D => C(L) RAR 7010 2 Rotate AC and L right. rotated right one place C(AC.) => C(AC. +1) a C(L)l C(ACll) :> C(L) 3-4 C(ACO) The C(AC) and the C(L) are . TABLE 3—2 GROUP I OPERATE MICROINSTRUCTIONS (continued) Mnemonic Octal Event Symbol Code Time RAL 7004 2 O p erat'0 n Rotate AC and L left. The C(AC) and the C(L) are rotated left one place. C(ACO) => C(L) C(L) 3) C(Ac1 1) 7012 RTR Rotate two places to the right. 2 Equivalent to two successive RAR operations. RTL 7006 Rotate two places to the left. 2 Equivalent to two successive RAL operations. 700i IAC 2 Index AC. The C(AC) are incremented by one in 2's complement arithmetic . C(AC)+T => C(AC) 7000 NOP No operation. — Causes a I .5 psec program delay. Group 2 operate microinstruction format is shown in Figure 3—4, and the microinstructions are listed in the table below. Any logical combination of bits within this group can be composed in one microinstruction. REVERSE OPERATION CODE 7 CLA r———*-——\ r—Afl O I 2 3 SZA SENSING OF BITS 5,6,7 HLT r—H H—fi F—‘fl 6 5 4 7 8 9 10 \_.Y_J H—’ k_w_l 9T4 L_w_l CONTAINS A t TO SPECIFY SMA SNL 05R CONTAINS A 0 TO SPECIFY GROUP 2 GROUP 2 Figure 3-4 1I Group 2 Operate Microinstruction Format If skips are combined in a single instruction, the inclusive OR of the conditions determines the skip. For example, if I's are designated in bits 6 and 7 (SZA and SNL), the next instruction is skipped if either C(AC) = 0, or C(L) = I, or both. If two reverse sense skip instructions are combined (bit 8 is set), the logical AND of the conditions determines the skip. For example, if I's are designated in bits 6, 8 (SNA and SZL), the next instruction is skipped if C(AC) f 0 from to 2E C(L) = 0. 7, and The CLA microinstruction Group I can be combined with Group 2 commands. This command occurs at event time 2 with respect the event times listed in the following table . 3—5 TABLE 3-3 Mnemonic Octal Symbol Code CLA 7600 GROUP 2 OPERATE MICROINSTRUCTIONS Operation Clear AC. 0 => C(AC) SPA Skip on positive AC. If the C(AC) is a positive number, the next instruction is skipped. If C(ACO) 0, then C(PC) + l => C(PC) 75l0 = SMA 7500 Skip on minus AC. If the C(AC) is a negative number, the next instruction is skipped. It C(ACO) i, then C(PC) + 1 => C(PC) = SNA 7450 Skip on non-zero AC. lf C(AC) 75 0, then C(PC) +i => C(PC) SZA 7440 Skip on zero AC lf C(AC) 0, then C(PC) + l => C(PC) . , = SZL 7430 Skip on zero L. if C(L) O, the next instruction is skipped. lf C(L) 0, the C(PC) + l => C(PC) = = SNL 7420 Skip on non-zero L. If C(L) i, then C(PC) + 1 => C(PC) = SKP 74l0 Skip, unconditional. C(PC) + 1 => C(PC) OSR 7404 OR with switch register. The next instruction is skipped. (May be combined with CLA.) C(SR) V C(AC) => C(AC) HLT Halt. 7402 Stops the program. If this instruction is com- bined with others in the CPR 2 group, the computer stops immediately after completion of the cycle in process. THE ORGANIZATION OF MEMORY A PDP-8 memory Field can be likened to a book. The 4,096 words of the memory field correspond to the lines of text, and if we divide the memory into segments of l28 words each, we have an analogy to a 32-page book in which each page contains 128 lines. The memory field is in fact segmented in this fashion, and the analogy to a book is affirmed by the fact that each of the l28-word blocks is called a page. to allow direct reference to all be provided. Because the PDP-8 instruction word is not long enough of the registers in a memory field, a special type of address reference must This can be illustrated by pursuing our book analogy a little bit farther. Suppose that one is reading a text, and taking notes in the margins of each page. some of the notes will refer to other parts of the page, or to information on One can expect that other pages. if one of the notes refers to a line of text on the same page, write only the line number. For convenience, If the note re- fers to a line on some other page, write the page number followed by the number of the line on that page. Alternatively, of course, it is possible to begin on the first page and number all the lines of the book con-M secutively, and refer to them by these numbers alone. In similar fashion, a given word of memory may be referred to by its page address; that is, its address within a page, or by its absolute address, which designates its position in the whole of memory. analogy ends . A PDP—8 memory field is organized as follows: the 4,096 words are arranged sequentially, with absolute 77778. The field is divided into 32 pages numbered from 0-378. Each page addresses of 0 through tains l28 registers, with page addresses of O—l77 8 . As Figure 3-l If bit 4 of the instruction contains a con— shows, the address field of a memory field of a memory reference instruction contains 7 bits, which is iust enough to allow access to locations. Here the 2008 l, the address field of the instruction refers to one of the addresses on the current page, that is, the page in which the instruction is stored. If bit 4 contains a 0, the reference is to an address on page 0. The state of bit 3 of the instruction determines what is done with the contents of the memory register specified by bits 4-l l . if this bit is O, the contents of the cell addressed by the instruction are taken as the operand, and the operation is completed. effective address of the instruction. are In this case, the address specified by the instruction is the lf, however, bit 3 contains a i, the contents of the cell addressed treated, not as the operand, but as the l2-bit absolute address of the register containing the operand. in other words, the cell addressed contains the effective address of the instruction. ory reference instruction can in this way, a mem— indirectly address any register in the memory field, regardless of which page it is on. Thus, there are four ways, depending on the states of bits 3 and 4 of a memory reference instruction, in which the effective address may be obtained TABLE 3-4 Bit 3 Bit 4 0 0 . EFFECTIVE ADDRESS CALCULATION Effective Address The operand is in page 0 at the address specified by bits 5 through ll 0 l . The operand is in the current page at the address specified by bits 5 through ll. 3—7 TABLE 3—4 EFFECTIVE ADDRESS CALCULATION Bit 4 Bit 3 (continued) Effective Address The absolute address of the operand is taken from the contents of the location in page 0 designated by bits 5 through II. The absolute address of the operand is taken from the contents of the location in the current page designated by bits 5 through II. COMPLEMENT ARITHMETIC In the PDP-8, as in other machines utilizing complementation techniques, negative numbers are repre— sented as the complement of positive numbers, and subtraction is achieved by complement addition. Representation of negative values in 2's complement arithmetic is slightly different from that in I's com— plement arithmetic . The I's complement of a number is the complement of the absolute positive value; that is, all I‘s are re— placed by 0's and all 0's are replaced by I's. The 2's complement of a number is equal to the I's com- plement of the positive value plus one. In I's complement arithmetic a carry from the sign bit (most significant bit) is added to the least significant bit in an end-around carry. In 2's complement arithmetic a carry from the sign bit complements the link (a carry would set the link to I if it were properly cleared before the operation), and there is no end-around carry . A I's complement representation of a negative number is always one less than the 2's complement repre— sentation of the same number. Differences between I's and 2's complement representations are indicated in the following table. TABLE 3-5 ONE'S AND TWO'S COMPLEMENT REPRESENTATIONS Number One's Complement Two's Complement 000000000] OI +5 000000000I OI +4 000000000I 00 000000000100 +3 0000000000I I +2 0000000000 I 0 00000000001 I 0000000000 I 0 + I 00000000000I 00000000000I +0 000000000000 000000000000 -0 IIIIIIIIIIII Nonexistent —I IIIIIIIIIIIO IIIIIIIIIIII 3—8 TABLE 3—5 ONE'S AND TWO'S COMPLEMENT REPRESENTATIONS (continued) Number One's Complement Two's Complement -2 111111111101 111111111110 -3 llllllllllOO 111111111101 -4 lllllllllOll 111111111100 —5 111111111010 111111111011 Note that in 2's complement there is only one representation for the number which has the value zero, while in l's complement there are two representations. Note also that complementation does not interfere with sign notation in either l's or 2's complement arithmetic; bit 0 remains a 0 for positive numbers and a l for negative numbers. PDP-8 arithmetic operations (as exemplified by the TAD instruction) are carried out in 2's complement. This means that the operands involved in the arithmetic must be in correct 2's complement representation. The 2's complement of any number is formed by taking the l's complement, and adding 1 to it. The two operate class instructions, CMA and lAC, may be combined into a single instruction to perform the operation of taking a 2'5 complement. Because the operation is often required, the mnemonic CIA is given to the combined instruction. Addition The addition of a number contained in a core memory location and the number contained in the accumulator is performed directly by using the TAD Y instruction, assuming that the binary point is in the same position and that both numbers are properly represented in 2's complement arithmetic. Addition can be performed without regard for the sign of either the augend or the addend. Overflow is possible, in which case the result will have an incorrect sign, although the eleven least significant bits will be correct. carry from bit 0 will complement the link bit. Subtraction Subtraction is performed by complementing the subtrahend and adding the minuend. As in addition, if both numbers are represented by their 2's complement, subtraction can be performed without regard for the signs of either number. 3-9 A CHAPTER 4 ORGANIZATION The rules for writing a program can best be introduced by tracing the steps from the statement of a problem to the completed routine. Consider, for example, a program to compute the sum of the first n integers, s=n+(n-I)+(n—2)+(n—3)+ ...+3+2+I First, a flow chart, that is, a block diagram of the general steps to the solution of the problem, should be made. It might look something like Figure 4-] . Ignoring the first box for the moment, consider the second, third, and fourth boxes. The operations specified in these three boxes perform the main computation of the sum. Box 2 specifies the actual arithmetic of computing the partial sum. which counts the number of partial additions that have been made. Box 3 is a counter, Box 4 is a decision point; if the count indicates that the sum is complete, the program goes on to box 5; if it is not complete, the program returns to the beginning of the main computation. program is called a This sort of continuous recycling through a section of loop. I 2 3 CLEAR TEMPORARY REGISTERS AND INITIALIZE CALCULATE sum PARTML ‘ DECREMENT uuosx NO 4 YES 5 Figure 4-] HALT Flow Chart of Program to Calculate Sum of Integers The first box in this chart specifies the operations which prepare the program for operation. Since nearly every program written will be used more than once, with different data each time, it is necessary at the 4—1 start of the routine to clear out old results from previous use of the program so that one can start fresh with new data, in the same way that one clears the keyboard and registers of an adding machine before starting a new calculation. In programming terms, this preparation is called initializing. Besides indicating the general sequence of operations, the flow chart also gives an idea of storage require— ments. Space will be needed not only for the instructions which perform the computation, but also for the data used by the routine. One register will be needed to hold the partial sum accumulated through re- peated additions; this register will naturally hold the correct total when the calculation is finished. Another cell is needed for the M, which is the counter specified in box 3 of the flow chart. one Finally, register is necessary to hold the number n, which determines the limit of the computation. The program, then, must supply two types of information. First, it must include the executable instructions, data, and temporary registers which will occupy memory cells when the program is executed. Second, it must include a certain amount of information for the MACRO Assembler itself, to establish the locations and extent of the program in memory. These assembler directives are called pseudo—instructions; included in the program along with the executable instructions. they are A pseudo—instruction is rather like a proofreader's mark on a manuscript; the mark provides information to the editor, but does not itself cause additional text to appear in the printed book. Similarly, a pseudo-instruction provides information to the Assembler, but does not itself cause any coding to be inserted into the object program. CODING Now to write the program. First one must decide where the program is to be stored. This word is called the MI necessary only to establish the location of the first register of the program. and can be designated in two ways. to be stored; To do this, it is The most common way is to designate the page in which the program is the origin is automatically set at the first register (page address 0) in that page. Thus, to put the routine in page 2, the pseudo-instruction, PAGE, would be used as follows: PAGE 2 The program would then begin in location 0 of page 2. To set the origin to any register other than the first one in a page, the absolute address of the starting location must be specified. This is done by using the special character "*" . To place the origin at loca- tion 210, the coding would be: *210 In establishing the origin, an index within the Assembler, called the current location counter (CLC), has been set equal to the absolute address of the origin. For example, the use of PAGE 2 would set the CLC 4-2 to a value of 400, which is the absolute address of the first register in page 2. the CLC to be set to a value of 210. Likewise, *210 causes In programming terms the CLC points to the origin; such an index is called a pointer. The coding for the program may now be written. First three registers for the three items of data must be Usually, data storage is set aside by placing a 0 in each register, thus allocating a cell. reserved. The coding looks like this: PAGE 2 O O 0 Since the origin has been set at location 400, the three data cells occupy locations 400, 40] , and 402 (page addresses 0, l, and 2, respectively). Next, write the coding For the computation. PAGE 2 0 0 0 CLA DCA 400 TAD 40] DCA 402 TAD 400 TAD 402 DCA 400 STA TAD 402 SZA JMP 406 HLT 33 The program now occupies locations 400—416 (0-16 on page 2). The special character $ indicates to the Assembler that it is a complete program and that nothing else is to follow. This program is now complete, and can be assembled into a working routine. The coding, however, is rather stark, and not very useful to another programmer, should he wish to discover what the program does. Of course, he could figure out the function of the routine by going through it step by step with pencil and paper, but if this program were much a longer, this task would be tedious and impractical. Comments, method of explaining the functions of the program, make the work immediately useful to someone else. COMMENTS Comments are included in a PDP-8 program in a simple way. our program. Consider the three data storage locations of A comment would identify each register's function immediately; they might appear as: /PARTIAL SUM AND FINAL TOTAL /|NTEGER N /INDEX 0 0- The slash preceding each comment is the character which identifies a comment field. All information on that line following the slash is considered to be a comment, and is ignored by the Assembler. For clarity and neatness, a tab has been inserted between the instruction and the comment. Since a slash identifies all the subsequent information on a line as a comment, one full line can be used for a title by placing the slash in the first space after the left margin. With a title, the program might look like this: /INTE GER SUMMATION ROUTINE PAGE 2 /PART|AL SUM AND FINAL TOTAL 0 Now, an immediate identification of what the program is to be used for is included in the listing. More comments explain the workings of the program: /INTE GER SUMMATION ROUTINE PAGE 2 o 0 0 /PART|AL SUM AND FINAL TOTAL /INTEGER N /INDEX CLA DCA 400 /ZERO TO SUM TAD 401 DCA 402 TAD 400 /SET INDEX /MAIN LOOP TAD 402 DCA 400 STA /DECREMENT INDEX 4-4 TAD 402 /IS IT 0? /NO: KEEP GOING /YES: HALT SZA JMP 406 HLT $ Now it is a little easier to understand the program, but some limitations remain. It is tied to one particu- lar place in the computer's memory; to put it in some other location, recoding the entire routine with new addresses would be necessary. Nor are these octaI page addresses much help in keeping track of program flow; even in a short routine such as this, it is necessary to do some counting to find out what location the instruction STA is in, for example. A simple, meaningful way of identifying storage addresses is needed. ADDRESS TAGS As described above, a symbol is assigned to each of the PDP-8 instruction codes. mer can Similarly, the program— assign a symbol to any one of the storage addresses in the computer memory. For instance, the routine under discussion contains three important registers: the beginning of data storage, the beginning of the program sequence, and the beginning of the main loop. Each one of these locations can be labelled with a symbolic tag, in the following way: /INTEGER SUMMATION ROUTINE PAGE 2 DATA, 0 /PART|AL SUM AND FINAL TOTAL /INTE GER N /INDEX 0 0 BEGIN, CLA DCA 400 /ZERO TO SUM TAD 401 GO, DCA 402 TAD 400 /SET INDEX /MAIN LOOP TAD 402 DCA 400 STA /DECREMENT INDEX TAD 402 SZA JMP 406 HLT /Is IT 0? /NO: KEEP GOING /YES; HALT $ Three reference points have been established. Note that the tags are roughly mnemonic, thus offering an additional measure of program identification and clarification. been defined. In programming terms, three symbols have In this case, each symbol has a value that is equal to the absolute address of the register in which the associated item (data word or instruction) is stored. of BEGIN, 403; of GO, 406. Thus, the value of the symbol DATA is 400; Symbolic Addressing Locating sections of a program has been simplified, but full advantage of address tags has not yet been taken. The instruction addresses themselves are still tied to the absolute addresses of the program. ever, since each How- tag has a numeric value corresponding to an address, a tag may also be used as a symbol in the address part of an instruction. For example, the absolute address 402 is clearly equivalent to the expression, BEGIN-l (BE GIN=403; 403—l=402). Similarly, the address 4]] is equivalent to GO+3. Replacing absolute addresses with symbolic expressions, the program will look like this: /INTE GER SUMMATION ROUTINE PAGE 2 /PART|AL SUM AND FINAL TOTAL /INTEGER N /lNDEX DATA, 0 0 o BEGIN, CLA DCA DATA /ZERO TO SUM TAD DATA+I Go, DCA DATA+2 TAD DATA /SET INDEX /MAIN LOOP TAD DATA+2 DCA DATA STA /DECREMENT INDEX TAD DATA+2 SZA JMP Go HLT /IS IT 0? /NO: KEEP GOING /YES: HALT $ This program that is easily readable, includes a running commentary for explaining its functions, and carries its own symbolic references that further assist in understanding and keeping track of the routine. Moreover, the routine has been freed from a specific place in memory by the use of symbolic addresses. To change the location of the program, it is necessary only to change the origin setting by the PAGE pseudo-instructions . STORAGE TECHNIQUES The program above will function but it may be improved. One of its drawbacks is the fact that wherever the program is stored, the data must be stored right along with it. When space is at a premium, as it often is, it would be desirable to put all of the data in a fixed place, and let the working parts of the program be arranged as necessary. In the PDP-8, data that is used by several parts of a program is often stored in page 0. If each of the three data words in the program is given a name, page 0 addresses can be assigned to them. 4-6 Call the first word TOTAL, the second INDEX, and the third N . In effect, the data words have been labeled with address tags, but since the names can be used in symbolic expressions (for instance, in an instruction address), programmers usually refer to them as variables. If the variables are assigned to page 0 and the instruction address in the program changed to match, the coding will look like this: /| NTE GER SUMMATION ROUTINE *20 TOTAL, INDEX, N, 0 0 /THESE REGISTERS ARE /Now ON PAGE 0 0 PAGE 2 BEGIN, CLA DCA TOTAL /ZERO TO SUM TAD N GO, DCA INDEX TAD TOTAL /SET INDEX /MA|N LOOP TAD INDEX DCA TOTAL STA /DECREMENT INDEX TAD INDEX SZA JMP GO HLT /IS IT 0? /NO: KEEP GOING /YES: HALT $ When the program is loaded, the three items of data (having been assigned addresses on page 0) will be stored in page 0. A large step toward our goal of a refined, useful routine has been taken; i.e., a program which may be placed anywhere in memory and is easily understood and interpreted by someone other than the author, because of liberal comments and symbolic addressing. OPTIMUM USE It remains only to relate this sequence of coding to the context in which it is likely to operate. Obviously the summation program is useless in core by itself, waiting for an integer summation to be carried out. Since the example has served its purpose in illustrating how a complete program can be written, all the coding except the minimum necessary for the actual computation will be removed, leaving this (the ellipsis always indicates the presence of unspecified coding): 4-7 BEGIN, CLA DCA TOTAL /ZERO TO SUM TAD N GO, DCA INDEX TAD TOTAL /SET INDEX /MAIN LOOP TAD INDEX DCA TOTAL /DECREMENT INDEX STA TAD INDEX /IS IT 0? /NO: KEEP GOING /YES: HALT SZA JMP GO HLT This sequence can now be placed within a larger program wherever it may be needed. example of a long program which uses this routine two times. Figure 4-2 is an Whenever the summation routine occurs, it is preceded by an instruction which takes the value of N from the AC and places it on the proper location in data storage. One other change is also necessary. The address tag G0 has been eliminated from all but the First occurrence in the coding sequence; it is obvious that one symbol cannot be defined with more than one value, or there would be confusion as to which of the values was meant at any one time . As a result, it is necessary to eliminate the reference to GO in the JMP instruction at the end of the sequence . Notice that the instruction, DCA INDEX always remains exactly seven locations ahead of the JMP in- struction, regardless of where the routine is stored. Evidently, an address expression which could refer to the a location of DCA INDEX relative to the location of the JMP instruction is needed. In other words, construction is desired that will perform the same function as the following but without having to define the symbol HERE: DCA INDEX TAD INDEX HERE, JMP HERE-2 Remembering that the current location counter always llpoints" to the location of the instruction currently being assembled, it becomes apparent that what is desired is a symbol which, whenever it is used, film takes the value of the CLC . In MACRO-8, this symbol is the period, " ." . Whenever this character is encountered in an address expression, the value of the CLC is substituted for it. In the example in Figure 4-2 it is used in the address of the JMP instruction wherever it appears in the routine. the necessity of having to define a new set of symbols each time the routine is used is avoided. In this way, PAGE 10 BEGIN, GO, /INITIALIZATION DCA N DCA TOTAL TAD N DCA INDEX TAD TOTAL TAD INDEX DCA TOTAL /SET INDEX /MAIN LOOP /|NCREMENT INDEX STA TAD INDEX GO /IS IT 0? /NO: KEEP GOING /YES: ALL DONE /IN|T|ALlZATION SZA JMP DCA N DCA TOTAL TAD N DCA INDEX TAD TOTAL TAD INDEX TOTAL DCA /SET INDEX /MAIN LOOP /DECREMENT INDEX STA TAD INDEX /Is IT 0? /NO: KEEP GOING /YES: ALL DONE SZA IMP .-7 Figure 4-2 Program Example SUBROUTINES Now the program example is useful, but one more difficulty must be overcome. An examination of Figure 2-4 will make thisproblem obvious: If the routine is used very many times, an extremely large amount of storage space will be used simply in repetitions of the same coding sequence. the general aim of writing a concise, efficient program. This counteracts If the routine could be written only once, placed in a separate section of memory and called into operation each time it was needed, the whole procedure would be more efficient. 4~9 A program that may be used in this manner is called a subroutine. It is a sequence of coding with the fol lowing properties: I. It is self-contained, that is, it can be assembled by itself without having to be part of a larger program. 2. It occupies its own section of memory, 3. It performs only one task. 4. It is called into operation only by another program, and when it has finished its task, it returns to that program logically separate from other coding sequences. Each subroutine has a definite purpose. . It can be called any number of times, and upon com- pletion always returns control to the point from which it was last called. 5. a When necessary, it uses data supplied by the calling program, and returns results to place accessible by that program . When a subroutine is written, four requirements which are implied by the last two properties listed above must be fullfilled: Q The data must be accessible by the subroutine. 0" The results must be accessible by the calling program. 0 There must be a way of calling the subroutine into operation d . . There must be a way of returning control to the calling program . The problem of data transmission has been solved by placing the three data storage registers in page 0, thereby making them accessible to any program or subroutine in memory. return is not quite so obvious. The transfer and control of First, restore the symbolic tags to the subroutine as well as the title and other pseudo-instructions to make it a self-contained program giving: /INTEGER SUMMATION SUBROUTINE PAGE 2 INTSUM, DCA N DCA TOTAL /SAVE INPUT IN C(AC) /ZERO TO SUM TAD N GO, DCA INDEX TAD TOTAL /SET INDEX /MAIN LOOP TAD INDEX DCA TOTAL STA /DECREMENT INDEX TAD INDEX /IS IT 0? /NO: CONTINUE /YES SZA JMP GO At a first glance, it could seem easy to eliminate the problem of transferring control to the subroutine. A JMP INTSUM in the calling program every time the subroutine was called would provide the path. But The subroutine has no way of knowing where to return. The what happens at the end of the calculation? subroutine cannot merely halt as this violates requirement d above. The solution lies in the use of the JMS instruction. Remembering from Chapter 2 when the JMS instruction is executed, the contents of the program counter are saved‘ in the location addressed by the instruction, and control is transferred to the register immediately following the one addressed. contains the address of the next instruction following the JMS is available. Thus, a register which This can be used to return to the proper point in the calling program when the subroutine has finished its computation. Rearrange the first part of our subroutine as follows: /INTEGER SUMMATION ROUTINE PAGE 2 INTSUM, 0 DCA N DCA TOTAL /SAVE PC HERE /SAVE INPUT NUMBER /ZERO TO SUM TAD N GO, DCA INDEX /SET INDEX Now, whenever the instruction JMS INTSUM is used, the contents of the program counter are stored in the location tagged with the name INTSUM and the computer continues operation with the instruction imme- diately following which is the first instruction of the subroutine. Now that the subroutine has been called, a means to exit from it must be provided. stores the program counter which The JMS instruction ”points" to the instruction following the JMS. After the execution of a JMS INTSUM, the register INTSUM contains the contents of the program counter at the time the JMS was executed. return to This can be used as an effective address (See Chapter 3 , the "Organization of Memory") to the point of call. To do this, the subroutine may be terminated with a JMP instruction which references the register INTSUM as an indirect address as follows: 4-II /lNTE GER SUMMATION SUBROUTINE PAGE 2 DCA N /SAVE PC HERE /SAVE INPUT NUMBER JMP l lNTSUM /YES: lNTSUM, 0 The character "I" is used to signify indirect addressing. EXIT SUBROUTINE In use here it means, "Jump to the register whose address is contained in the register tagged lNTSUM." The complete subroutine is shown below: (not including the page 0 definition of the variables). /lNTE GER SUMMATION SUBROUTINE PAGE 2 INTSUM, o DCA N DCA TOTAL /SAVE PC HERE /SAVE INPUT NUMBER /ZERO TO SUM TAD N GO, DCA INDEx TAD TOTAL /SET INDEX /MA|N LOOP TAD INDEX DCA TOTAL STA /DECREMENT INDEX TAD INDEX SZA JMP GO JMP I INTSUM /IS IT 0? /NO: CONTINUE /YES: ALL DONE The reader is referred to the PDP—8 Library For other examples of subroutine calling techniques. The MACRO—8 Programming Language may now be discussed in detail. PART THE MACRO 2 LANGUAGE CHAPTER MACRO—8 5 PROGRAMMING LANGUAGE The MACRO-8 Symbolic Assembler accepts source programs written in symbolic them into binary form. memory locations language and translates MACRO—8 produces an obiect program tape (binary), a symbol table defining (for use with DDT), an octal/symbolic assembly listing, and useful diagnostic messages. MACRO-8 is compatible with PAL Ill, but has the following additional Features: User-Defined Macro's Groups of computer instructions required for the the solution of a specific problem can be defined as a macro Double Precision Integers instruction by the user. Positive or negative double precision integers are allotted two consecutive core locations. Floating Point Constants The format and rules for defining these constants are compatible with the format used by the PDP—8 Floating Point Package (See Digital—8-5-S). Operators Symbols and integers may be combined with a number of operators + - Literals Addition & Boolean AND Subtraction '. Boolean lnclusive OR Symbolic or integer literals (constants) are automatical ly assigned Text Facility . . There are text facilities for singl 3 characters and blocks of text. Link Generation Links are automatically generated for out of page references . To incorporate these new features, it was necessary to decrease the size of the symbol table and because of this, programs that were originally coded to be assembled by PAL lll might have too many symbols to be assembled by MACRO-8. 5-l CHARACTERS Programs in the MACRO—8 language are written using characters from the ASCII character set. The following characters are used: Letters ABCD...XYZ Digits i234567890 Punctuation Characters Since a number of characters are invisible (i .e., nonprinting), the following notation is used to represent them in the examples: ._I space ___>| tab ) carriage return The Following characters are used to specify operations to be performed upon symbols or numbers: Character 253 space Combine symbols or numbers plus Combine symbols or numbers (add) minus Combine symbols or numbers (subtract) exclamation point Combine symbols or numbers (OR) J carriage return Terminate line _H tab Combine symbols or numbers or format source Ll + tape comma Assign symbolic address equals Define parameters ; semicolon Terminate coding line $ dollar sign End of pass * asterisk Set location counter point Has value equal to current location counter , = 5—2 / slash Indicates start of a comment & ampersand Combine symbols or numbers (AND) quote Generate ASCII constant ( ) parentheses Define literal on current page [ ] brackets Define page 0 literal < > angle brackets Define a macro " Ignored Characters End of a Form-feed logical page of a source program (see Symbolic Editor) leader/trailer Blank tape Used for Rubouts Used for deleting characters Code 200 Used for leader/trailer Line-feed Follows carriage-return All other characters are illegal when not in a comment or a TEXT field, and cause the error message lC to be printed. The form—feed is used at the end of a page of program for editing purposes. of leader and trailer are self-explanatory. The functions This may be either blank tape or code 200. Tabulations are usually used in the body of a program to provide a neat page for printing; they can separate fields from one another, as between an instruction and an associated comment. For example, a line could be written as: (30, TAD TOTAL/MAIN LOOP) but it is far easier to read if tabs are inserted: GO, —>l TAD TOTAL —Dl /MAIN (the characters —§l and Either ; ,l are LOOP) nonprinting) (semicolon) or the combination carriage-return/line-feed may be used as line terminators. The semicolon is considered identical to carriage-return/line—feed except that it will not terminate a comment. Example: TAD A /THIS IS A COMMENT The entire expression up to the carriage return is considered a comment. 5-3 ,- TAD B’) As was noted previously, the tabulation is used as a Formatting device to provide a neat appearance for Use of the semicolon allows the programmer to place several lines of coding the printed program listing. on a single line. If, for example, he wishes to write aysequence of instructions to rotate the C(AC) and C(L) six places to the right, it might look like: RTR) RTR) RTR) He may place all three instructions as a single line by substituting the control character for the line terminator RTR; RTR; ") ” (carriage return). , (semicolon) The above sequence of instructions may be rewritten as: RTR) This type of format is particularly useful when setting aside a section of data storage for a list. For ex- ample, a lZ-word list could be reserved by: LIST, 0; 0; 0; 0; 0; 0‘) 0; 0; 0; 0; 0; 0‘) A neat printout (or program listing, as it is usually called) makes subsequent editing, debugging, and interpretation much easier than if the coding were laid out in a haphazard fashion. The coding practices listed below are in general use, and will result in a readable, orderly listing. a program to produce listings of this form.) l. A title comment begins at the left hand margin. 2. Pseudo-instructions may begin at the left margin; often, one tab stop to line up with the executable instructions. 3. Address tags begin at the left margin. a tabulation (See Digital-8—21—U for however, they are indented They are separated from succeeding fields by . 4. Instruction fields, whether or not they are preceded by a tag field, are indented one tab stop 5. A comment is separated from the preceding field by a tabulation, unless it occupies the whole . line, in which case it usually begins at the left margin. 5-4 Elements Any group of letters, digits, and punctuation characters which represents binary values less than 2] . . . . . 2 . IS an element. Integers Any sequence of numbers delimited by punctuation characters forms a number. Example: l l2 4372 The radix control pseudo-instructions indicate to the Assembler the radix to be used in number interpre— tation. The pseudo-instruction DEClMAL indicates that all numbers are to be interpreted as decimal until the next occurrence of the pseudo-instruction OCTAL. The pseudo-instruction OCTAL indicates that all numbers are to be interpreted as octal until the next occurrence of the pseudo-instruction DEClMAL. less otherwise specified The radix is initially set to octal and remains octal un- . Symbols A symbol is a string of one or more alphanumeric characters delimited by a punctuation character. are Symbols composed according to the following rules: l The characters must be either alphabetic (A-Z) or numeric . (0—9) . 2. The first character must be alphabetic. 3. Only the first six characters of any symbol are meaningful; the remainder, if any, are ignored. 4. A symbol is terminated by any nonalphanumeric character. The MACRO Assembler has, in its permanent symbol table, definitions of the symbols for all PDP—8 operation codes, operate commands, and many lOT commands (see Appendix A for a complete list). used without prior definition by the user. JMS Example: is a symbol whose value of 4000 is taken from the operation code definitions . These may be is a user—created symbol. A When used as a symbolic address tag, its value is the address of the instruction it tags. This value is assigned by the Assembler. Note that because of rule 3, a symbol such as INTEGER, for instance, would be interpreted as INTEGE since the seventh letter is ignored. if symbols of more than six characters are used, the programmer should be careful to avoid the error of defining two apparently different symbols whose first six characters are, in fact, identical. For example, the two symbols, GEORGEl and GEORGEZ, differ only in the seventh character, so that the Assembler would treat them as being the same symbol, GEORGE It is not necessary to define a symbol before it is used in an expression. end of PASS 1, however. . They must be defined before the Thus, one may refer to a number of registers by their address tags, and then define the symbols later. Parameter Assignments A symbol may be assigned a value by means of a parameter assignment statement which looks like an alge- The single symbol to the left of the equal sign is assigned the value of the expression on braic statement. the right. No space(s) or tab(s) may appear between the single symbol to the left of the equal sign and the equal sign Examples: . A = 6 EXIT C = = JMP I 0 A + B All symbols to the right of an "=" sign must be already defined. The symbol to the left of the "=" sign and its associated value is stored in the Assembler's symbol table. The use of the "=" does not increment the current location counter. Assembler itself rather than a part of the output binary. The equal sign may be used to redefine a symbol. Symbol Definition A symbol may be defined by the user in one of three ways: i . By use of a parameter assignment. Example: DlSMlS = JMP RESTOR 5-6 It is, rather, an instruction to the 2. As a macro name. Example: DEFINE LOAD A < CLA TAD A > 3. a By use of the comma. When a symbol is terminated by a comma, it is assigned value equal to the current location counter. Example: /SET CLC T0100 *100 TAG, CLA B, A, 0 JMP A DCA B The symbol "TAG” is assigned a value of 0100, the symbol "B" a value of 0102, and the symbol "A" a value of 0103. Expressions All elements, i.e. , symbols and numbers (exclusive of pseudo—instruction symbols, macro names, and double precision or floating point constants) may be combined with certain operators to form expressions. These operators are: + This signifies 2's complement addition (modulo plus 409610). - This signifies 2's complement subtraction (modulo minus 409610). I exclamation point This signifies Boolean inclusive OR (union). & ampersand This signifies Boolean AND (intersection). u—I space Space is interpreted in context. It may signify inclusive OR or act as a field delimiter. Symbols and integers may be combined with any of the above operators. ated from left to right; no A symbolic expression is evalu— grouping of terms is permitted. Example: A g A+ B A-B A 1 B 0005 7777 _A_§§ Value 0002 0003 0003 0002 Value 0007 0005 0014 0002 0007 0005 Value 0700 0007 0707 0671 0707 0000 The MACRO-8 Assembler makes a distinction between the types of symbols it is processing. are These types i) permanent symbols, 2) user defined symbols, and 3) macro names. The character "space" is inter— preted written in the context of the expression. If a space is used to delimit two or more permanent sym— bols, space signifies inclusive OR. Example: CLA is a permanent symbol whose value is 7200. CMA is a permanent symbol whose value is 7040. The expression: has a value of 7240. CLA .__,CMA If the symbol following the space is a user defined symbol, space acts as an address field delimiter. Example: *2117 CLA A, JMP ._. A ”A" is a user defined symbol whose value is 2H7. The expression JMP ._. A is evaluated as follows: The seven address bits of A are taken, i.e.: A 010 00] 001 ill 1 001 iii The remaining five bits of A are tested to see if they are 0's (page 0 reference); if} they are not, the current page bit is set. 000 OH 001 iii The operation code is ORed into the expression: 000 000 AddressA 000 01] DOT iii 001 ill JMP JMP or, written more 5317 A 101 iOi Oil concisely: 000 In addition to the above outlined tests, the page bits of the address field are compared with the page bits of the current location counter. If the page bits of the address field are nonzero and do not equal the page bits of the current location counter, an out-of-page reference is being attempted. If the reference is to an address not on the page where the instruction will be located, the Assembler will set the indirect bit (bit 3) and an indirect address linkage will be generated on the current memory page. page reference is already an indirect one, the error diagnostic II (Illegal Indirect) will be typed on When the link is generated, the LG (Link Generated) message will be typed on PASS 2. PASS 2. case If the out-of— In the of several out-of-page references to the same address, the link will be generated only once, but the LG message will be printed each time. Example: *2117 CLA A, a *2600 JMP ._. A The space preceding the user defined symbol "A” acts as an address field delimiter. The Assembler will recognize that the register tagged "A" is not on the current page (in this case 2600—2777) and will generate a link to it as follows: in location 2600 the Assembler will place the word 5777 which is JMP I 2777 in address 2777 (the last location on the current page), the word 2i I7 (the actual address of ”A") will be placed. The address field of a memory reference instruction may be any valid expression. Example: A=27O * 200 TAD A—20 would produce, in location 200, the word OOI OIO 101 000 or I250 (TAD 250) Although the Assembler will recognize and generate an indirect address linkage when necessary, the programmer may indicate an explicit indirect address by using the special symbol I'I" between the operation code and the address field. This must be The Assembler cannot generate a link for an instruction that is already specified as being an indirect reference. II . (Illegal Indirect). 5—9 In this case, the Assembler will type the message Current Address indicator The single character period (.) has, at all times, a value equal to the value of the current location It may be used as any integer or symbol counter. (except to the left of an equal sign). Example: *200 JMP .+2 ls equivalent to JMP 202. * . 300 +2400 would produce, in register 0300, the quantity 2700. *2200 CALL=JMS l . 0027 Since the second line, CALL=JMP l ., does not increment the current location counter, 0027 would be placed in register 2200 and CALL would be placed in the symbol table with an associated value of 100 110 000 000 or 4600. Origin Setting The origin (current location counter) is reset by use of the special character asterisk (*). location counter is set to the value of the expression following the “*". 0200. All symbols to the right of "*" must already have been defined. The current The origin is initially set to Example: lf D has the value 250 then *D+lO will set the location counter to 0260. To simplify page handling, the pseudo-instruction PAGE may be used. the origin is reset to the first location of the next page. A page number may be specified by a legal expression following the page pseudo-instruction. Example: * at this 270 point, either When "PAGE" is encountered, *400 PAGE PAGE 2 will reset the origin to 0400. Literals Since the symbolic expressions which appear in the address part of an instruction usually refer to the loca— tions of registers containing the quantities being operated upon, the programmer must explicitly reserve the registers holding his constants. The MACRO—8 language provides a means for using a constant directly. Suppose, for example, that the programmer has an index which is incremented by two. One way of coding this operation would be as follows: cL'A TAD INDEX TAD C2 DCA INDEX C2, 2 Using a literal, this would become CLA TAD INDEX TAD (2) DCA INDEX The left parenthesis is a signal to the Assembler that the expression following is to be evaluated and as- signed a register in the constants table of the current page. address linkages are stored. This is the same table in which the indirect In the above example, the quantity 2 is stored in a register in a list begin- ning at the top of the memory page (page address T77), and the instruction in which it appears is encoded with an address referring to that address. A literal is assigned to storage the first time it is encountered; subsequent references will be to the same register. If the programmer wishes to assign literals to page 0 rather than the current page, he may use square brackets, "l" and ”] ", in place of the parentheses. may be omitted. However, in both cases, the right of closing member The following examples are acceptable: TAD AND (777) UMP) Note that in the second example, the instruction AND [JMP has the same effect as AND [5000. Literals may be nested. For example: *200 TAD (TAD (30 will generate 0200 i 376 0376 i 377 0377 0030 This type of nesting may be carried to as many levels as desired. at page address page 0). T77 and extending toward page address 0. Literals are stored on each page starting (Only 12710 or 1778 literals may be placed on If a literal is generated for a nonzero page and then the origin is set to another page, the current page literal buffer is punched out (during PASS 2). If the origin is then reset to the previously used page, the same literal will be generated it used again. Single Character Text Facility It a single character is preceded by a double quote, the 8—bit value of the ASCII code for the character is inserted instead of taking the letter as a symbol. CLA TAD ("A will place the constant 0301 in the accumulator. Example: CHAPTER 6 PSEUDO-INSTRUCTIONS The pseudo-instructions are directions to the Assembler to perform certain tasks or to interpret subsequent coding in a certain way. By themselves pseudo-instructions do not generate coding or (in general) effect the current location counter. The functions of each pseudo-instruction are described in this chapter. CURRENT LOCATION COUNTER PA GE This pseudo-instruction is used to set the current location counter. PAGE n This will reset the current location counter to the first address of page n, where n is an integer, a previously defined symbol, or a symbolic expression. Examples: PAGE 2 will set the CLC to 0400 PAGE 6 will set the CLC to 1400 PA GE When used without an argument, PAGE will reset the CLC to the first location on the next succeeding page. Thus, if a program is being assembled into page i and the pro- grammer wishes to begin the next segment on page 2, he need only insert the pseudo- instruction PAGE, as follows: JMP .—7 PAGE CLA The current location counter may be explicitly set by use of the asterisk. EXTENDED MEMORY On PDP—8’s equipped with more than one memory bank, the pseudo~instruction FIELD n may be used where n is an integer, a previously defined symbol, or a symbolic expression within the range OSnS7. This pseudo-instruction causes a word of the form H XXX 000 where OOOSXXXS iii to be punched on the binary tape during PASS 2. This word is interpreted by the Extended Memory Binary Loaders (see Digital-8-2A-U; Digital-8—2B-U). RADIX CONTROL Normally, all integers used in a program are taken as octal numbers. If, however, the programmer wishes to have certain numbers treated as decimal, he may use the pseudo-instructions: DECIMAL When this pseudo-instruction occurs, all integers encountered in subsequent coding will be taken as decimal until the occurrence of the pseudo—instruction which will reset the radix to its original (octal) base. OCTAL NUMBERS The types of numbers allowed are integers (See Chapter 5), double precision integers, and double precision Floating point numbers. Double Precision Integers Double precision integers may be positive or negative (2's complement) according to their sign but may not be combined with operators. not disturbed. They are always taken as decimal radix although the current radix is Each double precision integer is allotted two consecutive registers with the sign indicated by bit 0 of the first word. The double precision integer mode is entered through the use of pseudo—instruction DUBL and all numbers encountered will be taken as double precision integers until an alphabetic character is encountered. Each number is terminated by the carriage return *400) 679467) 44) -3) DUBL TAG, CLA) would produce 0400 040] 0245 7053 0402 0000 0403 0054 () ) or the semicolon (;) or by a comment. Example: 0404 7777 0405 7775 0406 7200 and the symbol ”TAG" would have a value equal to 0406. Floating Point Constants Double precision floating point constants may be positive or negative according to their sign but may not be combined with operators. Decimal radix is assumed but the current radix is not altered. point constants are each assigned three registers and are stored in normalized form. Floating (See Digital-8-5-S for a description of floating point arithmetic.) The double precision floating point mode is entered through use of the pseudo-instruction FLTG. All numbers encountered after the use of FLTG will be taken as double precision Floating point constants until the occurrence of an alphabetic character other than E . The general input format of a floating point number is iddd -ddddEidd where the d's are decimal digits. Any character which is not legally part of the above format (except rubouts) terminates input of the number. Example: Produces *400 F LTG +509 32E . —62 97E . l .00E TAGZ, -02) 04) -2) CLA) 0400 0003 0401 2427 0402 6670 0403 0024 0404 5462 0405 0740 7772 0406 0407 , 2436 041 0 5574 041 i 7200 and the symbol ”TAGZ" would be assigned a value of 04]] . TEXT FACILITY There is a text facility for single characters and text strings. mode (double quote), see Chapter 5. 6-3 For a description of the single character A string of text may be entered by giving the pseudo—instruction TEXT followed by a space, a delimiting character, a string of text, and repeating the same delimiting character. Example: ATEXTA TEXT The character codes are stored two to a register in ASCII code that has been trimmed to six bits. the last character, a 6-bit zero is inserted as a stop code. Following The above statement would produce 2405 3024 0000 TEXT ._. /BOB/ would produce 02] 7 0200 The TEXT pseudo-op could also be used as part of a calling sequence to a subroutine: JMS MESS TEXT / a. / Or b. JMS MESS /NO WDS IN MESSAGE /ADDRESS OF MESSAGE NOWDS ADDMESS ADDMESS, TEXT / / Note that while the TEXT pseudo-instruction causes characters to be stored in a trimmed code, the use of the single-character control code (") causes characters to be stored as a Full 8-bit ASCII code. END OF PROGRAM The special symbol "$" indicates the end of a program. nates the PASS . When the Assembler encounters the "$" it termi- END OF TAPE When several tapes are to be assembled together, each, except the last (which ends in "$"), should have as its last symbol the pseudo-instruction PAUSE. and halt the computer. CONTINUE This causes the MACRO-8 Assembler to stop processing After placing a new tape in the reader, assembly can be continued by depressing . ALTERATIONS TO THE SYMBOL TABLE There are two pseudo-instructions that may be used to alter the permanent symbol table (during PASS l): EXPUNGE EXPUNGE the entire symbol FIXTAB FIX the symbol TABIe. table, except For the pseudo-instructions. All symbols that are currently in the symbol table are fixed. Example: CLSF=6l4l FIXTAB would define CLSF as a permanent symbol . EXPUNGE TAD=l 000 FIXTAB would place the symbol TAD in the assembler's permanent symbol table. been expunged . 6-5 All other symbols would have CHAPTER 7 MACROS When writing a program, it often happens that certain coding sequences are used several times with just the arguments changed. ment. If so, it is convenient if the entire sequence can be generated by a single state- To do this, the coding sequence is defined with dummy arguments as a macro. A single statement referring to the macro by name, along with a list of real arguments, will generate the correct sequence in line with the rest of the coding. The macro name must be defined before it is used. The macro is defined by means of the pseudo-instruction DEFINE followed by the macro's name and a list of dummy arguments. For example: A macro to move the contents of register A to register B and also leave the result in the accumulator, would be coded as follows: DEFINE <CLA _ MOVE _ TAD DUMMY] DCA DUMMY2 TAD DUMMY2> DUMMY] _. DUMMY2 The actual choice of symbols used as dummy arguments is arbitrary; however, they may not be defined or referenced prior to the macro definition. The above definition of the macro MOVE is identical to the following: DEFINE H <CLA;TAD MOVE _. ARGI; ARGIH ARGZ DCA ARGZ; TAD ARGZ> The actual definition of the macro is enclosed in angle brackets. When a macro name is processed by the assembler, the real arguments will replace the dummy arguments. For example: Assuming that the macro MOVE has been defined as above, *400 A,0 B, —6 0400 0000 0401 7772 MOVE _ A, B $ 0402 0403 0404 7200 1 200 3201 0405 1201 A macro need not have any arguments: NOTE: coding to rotate as a macro For example, a sequence of the C(AC) and C(L) six places to the left might be encoded by means of DEFINE.__. ROTL 6 <RTL; RTL; RTL> The entire macro definition is placed in the Macro Table, two characters per word, with a dummy argu- replacing the symbolic name. Example: ment value DEFINE LOAD._. A H <CLA TAD A> is stored, in the Macro Table, ICLlA)| TAl 0.. roughly as follows: l7700|>00| where the vertical lines indicate successive 12-bit words. are Comments and line-feeds not stored. The macro definition can consist of any valid coding except for TEXT or " type statements. RESTRICTIONS l . a Macros cannot be nested; i.e. , another macro name or definition cannot appear in macro definition and cannot be brought in as an argument at reference time. " type statements cannot appear in a macro definition. 2. TEXT or 3. Arguments cannot be: 4. a. Macro name b. TEXT pseudo-instruction or ‘' special character The symbols used as dummy arguments must not have been previously defined or referenced . 5. A macro may not be redefined. DEFINE LOOPH A H <TAD H Example: B A DCA B TAD COUNT ISZ B JMP .-2> The symbol "COUNT" is not a dummy argument but an actual symbol. A macro is referenced by giving the macro name, by commas. macro a space, and then the list of real arguments, separated There must be at least as many arguments in the macro reference as in the corresponding definition. When a macro is referenced, its definition is found, expanded, and the real arguments replace the dummy arguments. The expanded macro is then processed in the normal fashion. LOOP_ x, Y2 ..... is equivalent to: TAD X DCA Y2 TAD COUNT ISZ Y2 JMP .—2 The macro table shares the available space (60410 registers) with the table Thus the programmer must be aware of the amount of room resymbol quired by his macros and the fact that each symbol occupies four words of memory. Also, the arguments of a macro call are temporarily stored in this buffer space while the macro is being expanded. NOTE: . CHAPTER ERROR 8 DIAGNOSTICS The format of the error messages is: ERROR CODE ADDRESS Where ERROR CODE is a 2-character code which specifies the type of error, and ADDRESS is either the absolute octal address where the error occurred or the address of the error relative to the last symbolic tag (if there was one) on this page. Assembly will continue or may be continued after all errors except SE (Symbol Table Exceeded). error occurs, If an SE the Assembler will halt and may not be restarted. ERROR MESSAGES PE Current, Non-Zero Page Exceeded An attempt was made to l. override a literal with an instruction or 2. override an instruction with a literal. This can be corrected by ZE a. decreasing the number of literals on the page b. decreasing the number of instructions on the page Zero Page Exceeded Same as PE only with reference to page 0 Illegal Redefinition of a Symbol An attempt was made to give a previously defined symbol a new value not via the "=" . The symbol was not redefined. (This is similar to the Duplicate Tag diagnostic of PAL lll). lllegal Character l. # % ' : ? @\ were processed neither in a comment nor a TEXT field. The character is ignored and the assembly continued. 8-] A non-valid character was processed. 2. The computer will halt with the illegal character displayed in the accumulator. Assembly may be continued by putting the desired character in the SWlTCH REGISTER and depressing CONTINUE . lllegal Equals An equal sign was used in the wrong context. TAD A + A + B = = Examples: B (The expression to the left of the equal sign is not a single symbol) C lllegal Indirect An out of page reference was made, and a link could not be generated because the indirect bit was already set. * Example: 200 TAD l A PAGE CMA A, LG CLL Link Generated A link was generated for an out of page reference at this address. *200 Generated Binary TAD . Example: A . 0200 i 777 0377 0400 0400 7140 PAGE A, SE CMA, CLL Symbol Table Exceeded The Symbol Table overlaps the Macro Table or vice versa. Assembly is halted and cannot be continued. lllegal Format in 0 Macro Definition The expression after the DEFINE pseudo-instruction does not comply with the macro definition, position, or structural rules. Example: A macro name is referenced before the macro definition. 8—2 US Undefined Symbol A symbol has been processed during PASS 2 that was not defined by the end of PASS 1 MP . Missing Parameter in 0 Macro Call An argument, called for by the macro definition, is missing. Example: MAC DEFINE < TAD CIA DCA MAC BE B A A B > SUM Two MACRO—8 internal tables have overlapped. This situation can usually be corrected by de- creasing the number of current page literals used prior to this point on the page. If the error persists, please contact the Small Computer Systems Programming Group at Digital Equipment Corporation for assistance . CHAPTER OPERATING 9 INSTRUCTIONS MACRO-8 is a 2—pass assembler with an optional third pass which produces an octal/symbolic assembly listing. During the first pass, MACRO-8 processes the source tape and places all symbol definitions and macro definitions in its symbol table and macro table, respectively. During the second pass, MACRO—8 processes the source tape and punches the Binary Format Tape. At the end of PASS 2, MACRO-8 prints This punched table may be the Symbol Table (it is also punched if the 33—ASR PUNCH is turned on). read by DDT (See Digital-8-4—S) . The third pass provides a listing of the generated octal code and the original source language. There are two versions of MACRO—8 which differ with respect to their use of input/output equipment: the low speed version uses the 33-ASR Reader for all input and the 33-ASR Punch for all output; the high speed version uses the Type 750 Photoelectric Reader for all input, the Type 75 High Speed Punch for binary output, and the 33—ASR Punch for printable output such as error printouts, symbol table punching and listing, and third pass assembly listing. NOTE: In the high speed version of MACRO—8, the Type 75 Punch may be used as the printable output device by changing the contents of location 0004 from 2600 to 0600. This is useful for long third pass listings, since the punched It is advised that output from the 75 Punch can be subsequently listed off-line. this change not be made until pass 3, so that pass I and pass 2 error messages will come out on the 33-ASR. I . Load MACRO—8 with the Binary Loader (See Digital-8—2-U) 2. Put the source tape in the reader. 3. Set the SWITCH REGISTER to 0200. 4. Depress LOAD ADDRESS 5. Set switch options (See Table 9-1) 6 Depress START. . 7. . . Turn on the 33-ASR reader (if using the low speed version). . 8. When MACRO-8 stops reading (after processing a PAUSE statement), place the next tape in the reader and depress CONTINUE been processed . Repeat this step until all tapes have . 9. When MACRO-8 encounters the terminating character, dollar sign ($), it performs one of the following sets at events depending upon what pass has just been completed. Proper operator intervention is then required. Pass Just Completed I Events Operator Intervention Set up For PASS 2 Turn on 33-ASR punch (in high speed MACRO-8, symbol table is output via 33-ASR) Put source tape in reader; . hit CONTINUE to enter PASS 2. 2 (a) It PASS 3 is desired: (In the high speed version of MACRO—8, Terminate current assembly; punch out page 0 constants, checksum and trailer code on the contents of register 0004 could be binary tape; print and punch rubout, the alphanumerically ordered symbol table, an EOT altered at this point to change output code, a rubout, and trailer code; Set up for PASS I. switch 3 up at step 5. devices). Go to step 2 of the operating instructions, making sure to set AC (b) It PASS 3 not desired: Turn off 33-ASR punch, put next program to be assembled in the reader. Hit CONTINUE to enter PASS I. 3 Terminate assembly listing: Turn off 33-ASR punch; put next Setup for PASS I program to be assembled in the reader; hit CONTINUE to enter PASS I . . TABLE 9-] SWITCH OPTIONS Switch Up None Result MACRO-8 will enter the next pass as defined in the preceding table. example: For if the previous assembly was terminated during or at the end of PASS restarting MACRO-8 with no switches up would cause PASS 2 to be entered. MACRO-8 initially starts at PASS I . Restore symbol table to only the pemanent symbols and enter PASS I Enter PASS 2 . . I, TABLE 9—1 SWITCH OPTIONS (continued) Switch Up Result Enter PASS l without erasing any previously defined symbols. Enter PASS 3. During PASS 3, MACRO-8 outputs an octal/symbolic listing of the assembled program. If this pass is terminated before completion, either switch options 0 or 2 may be used to return to PASS 1 for subsequent assemblies. MACRO-8 will output as much of the source statement (symbolic) as its internal storage capacity will allow. Because of the internal operations during the processing of macro statements, the symbolic output may be meaningless. The double precision integer and double precision floating, point processors l0 are deleted and may be used for storage of user defined symbols. creases ll the size of the symbol table by 6410 symbols. The macro processor and the number processors (above) are deleted and may be used for storage of user defined symbols. table by NOTE: Switches 10 and ll to handle This in- This increases the size of the symbol l2510 symbols. are sensed whenever PASS l is entered. MACRO-8 would have to be reloaded subsequent programs that use macros, double precision integers, or floating point numbers. The Binary Format Tape produced during PASS 2 may be loaded by the Binary Loader. When the loading is completed, the accumulator should contain zero which indicates that it has loaded correctly. The PASS 3 output is of the following format: AAAA NNNN (Symbolic) CR/LF Where AAAA is the absolute octal address and NNNN is the generated code. of phase with the octal . Example: *200 0200 020] 0376 1377 TAD (1 3776 DCA A *4000 4000 0377 0001 4000 0000 A, 0 9—3 Literals are somewhat out SYMBOL TABLE MODIFICATION Because of the small amount 6f core macro (60410 registers) remaining to be used for programmer symbols and the table, the Following suggestions are offered which may allow a particular installation or individual to conserve on table space. By use of the pseudo-ops EXPUNGE and FIXTAB, unnecessary instruction mnemonics can be removed from the symbol table thus making more space available for programmer defined symbols and macros. This also decreases assembly time as the never used instruction symbols are not involved in the symbol table searches. The most often used instruction mnemonics should be assembled first, so that they will be in core next to the special characters and pseudo-instructions. This is desirable because the symbol search routine starts searching at the top of the table and works down. At an installation that does not have a piece of optional equipment available, the corresponding instruction set can be removed. A symbolic tape beginning with EXPUNGE, containing all necessary instruction mne- monics, and ending with FIXTAB and the $ sign could be assembled (only PASS I is needed) by MACRO-8 prior to any other assemblies. Example: EXPUNGE AND=0000 TAD=I 000 C LA=7200 FIXTAB $ (The pseudo-op PAUSE could also be used with this tape, the first of a multiple tape assembly.) APPENDIX MACRO-8 /MEMORY REFERENCE AND=OBOO SYMBOL TABLE INSTRUCTIONS KCC:6032 KRS:6934 KRB:GO$6 TAD=IZOO ISZ:2000 DCA:50@D /TELETYPE TELEPRINTER/PUNCH TSF:GOAI TCF:6042 JMS=AOOO JMP=SOOO IOT:GOOO OPR:7000 /MICROINSTRUCTIONS NOP:7000 TPC:6044 TLS:6946 /FLOATING POINT INTERPRETIVE COMMANDS FEXTZOOOO FADD:IOOO FSUB:2000 FMPY=SOOO FDIV:ADDO FGET:5§OO FPUT:6000 FNOR:7000 /OSCILLOSCOPE AND PRECISION CRT CLA:7ZOO CLL271OO CMA:7@4D CML:702@ RAR27OIO RTR:7@12 RAL:7004 RTL=7006 IAC:7ZOI SMA=752O fDISPLAY DCX:6051 DXL:6953 DCY:6061 DYL=6065 DIX:6@54 DIY:6664 DXS:6057 DYS:6067 DSF:6071 DCF:6072 DLB=6074 /INCREMENTAL PLOTTER PLSF:SSOI PLCF:6502 SZA=7440 SPA:75IO SNA=7450 SNL:7420 SZL:7460 SKP=74lO OSR:7404 HLT=7492 /COMBINED CIA=7041 LAS=7604 STA=7240 STL=7120 1 MICROINSTRUCTIONS PLPU:6504 PLPR=65II PLDU:6512 PLDD:6514 PLUD=6522 PLPL:6521 PLPD:6524 /LINE PRINTER LCF:6652 LPR:6655 LSF:6661 LCB:6662 LLD:6664 /CARD READER AND CONTROL CRSF=6652 CERS=6654 GLK:7204 /PROGRAM INTERRUPT ION:6001 IOF:6002 IANALOG TO DIGITAL CONVERTER ADC:6@OA /HIGH SPEED PERFORATED TAPE READER RSF=6011 RRB:60!2 RFC=SOI4 /HIGH SPEED PERFORATED TAPE PUNCH PSF:6021 PCF:6@22 PPC:6024 PLS=6026 /TELETYPE KEYBOARD/READER KSF=6051 CRRB:667I CRSA:6672 Al-l CRSB:6674 /CARD PUNCH CONTROL CPSF:6631 CPCF:664| CPSE=6542 CPLB=6644 /AUTOMATIC MAGNETIC TAPE CONTROL MSCR:67OI MCD:6702 MTS=6706 MSUR=6711 MNC:6712 MTC:6716 MSWF:6721 MDUF:6722 MCWF:6722 MEUF:6722 MIWFz6722 MSEF:6751 MDEF:6752 MCED=6732 MEEF:6752 MIEF26752 MTRS=6734 MCC:6741 MRWC:6742 MRCA:6744 MCA=6745 /COMBINED MMMM:6757 MMMF:6757 /AUTOMATIC INSTRUCTIONS MULTIPLY-DIVIDE RDAzsllZ MUL=6111 DIV:6121 SZO:6114 SAF:6124 RDM:6122 /MICROTAPE INSTRUCTIONS MMLS:6751 MMLM=6752 MMLF:6754 MMSF:6761 MMCF:6772 MMSC=6771 MMCC:6762 /CONVERTER DIGITAL ADSF:6551 ADCV=6552 ADRB=6534 ADCC=6541 ADSC=6542 ADIC=6544 ISERIAL MA GNETIC DRUM SYSTEM Dch:sszs DRcw=ssa5 DRCF:6611 DREF:6612 DRTS:6615 DRSE=6621 DRSC=6622 DRCN:6624 xzxrsnnzn ARITHMETIC ELEMENT muy:74zs DVI:7407 NMI:74ll SHL:7415 A5R:74xs LSR:7417 MQL:7421 CAM=6151 LAR:6104 LMQ26102 MMRS=6774 MMLC:6766 MMML:6766 IMEMORY PARITY smp:slal cmpzsnaz ITYPE 133/ 139 ANALOG TO SCA:744I MQA:7sz1 /MAGNETIC TAPE SYSTEM I1Fm:s7a7 TSRD:6716 Isz:s715 TSDF=6721 ISSR=6722 TSST:6724 TSRS:6754 rwnrzsvsx TCTI:6732 /MEMORY EXTENSION RDF:6214 RIF:6224 RMF:6244 RIB:6234 CDF:6201 CIF=6222 APPENDIX ASCII 2 CHARACTER SET These characters may be used in symbols. Character 8-Bit From 6—Bit From Character A 301 01 B 302 02 C 303 8-Bit From 6-Bit From S 323 23 T 324 24 03 U 325 25 D 304 04 V 326 26 E 305 05 W 327 27 F 306 06 X 330 30 G 307 07 Y 331 31 H 310 10 Z 332 32 I 31 1 1 1 0 260 60 J 312 12 1 261 61 K 313 13 2 262 62 L 314 14 3 263 63 M 315 15 4 264 64 N 316 16 5 265 65 O 317 17 6 266 66 P 320 20 7 267 67 Q 321 21 8 270 70 R 322 22 9 271 71 These characters are special. Character 8-Bit From 6-Bit From Meaning # 243 43 Inclusive OR Character pseudo-instruction Illegal outside of (TEXT) or (") or comment 5 244 44 End of PASS % 245 45 & 246 247 46 47 Illegal outside of (TEXT) or (") or comment Logical AND Illegal outside of (TEXT) or (") or comment 250 50 Define literal 251 51 Terminate literal 252 52 Set origin '. 241 41 " 242 42 ‘ ( ) * + , - . g / ' 253 53 2'5 complement addition 254 54 Define symbol 255 55 2'5 complement subtraction 256 56 Has value of CLC 257 57 Start of comment 272 72 Illegal outside of (TEXT) or (") or comment A2- 1 Character 8-Bit From A" 273 274 II Meaning 73 Terminate expression 74 75 Start macro definition End macro definition 277 76 77 300 00 Illegal outside of (TEXT) or (") or comment Illegal outside of (TEXT) or (") or comment 333 33 Define page 0 literal 334 335 34 35 End page 0 literal 336 337 36 37 Illegal Illegal 275 276 "‘/'—@-ov 6-Bit From Define Parameter Illegal outside of (TEXT) or (") or comment Line-feed 212 Used for formatting (ignored) Return 2I5 Terminate line Space 240 Address delimiter or inclusive OR Rubout Form-feed Blank Code 200 377 Ignored Ignored Ignored Ignored 214 000 200 EJflEflIEII EQ U l P M E N T CORPORATION MAYNARD. MASSACHUSETTS PRINTED IN USA.
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies