Digital PDFs
Documents
Guest
Register
Log In
DIGITAL-8-25-F
December 1965
70 pages
Original
2.7MB
view
download
Document:
digital-8-25-f-d
Order Number:
DIGITAL-8-25-F
Revision:
Pages:
70
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/digital-8-25-f/digital-8-25-f-d.pdf
OCR Text
8-5-5 DIGITAL EQUIPMENT CORPORATION. MAYNARD, MASSACHUSETTS PDP-8 FLOATING-POINT SYSTEM PROGRAMMING MANUAL September 1965 DIGITAL EQUIPMENT CORPORATION • MAYNARD, MASSACHUSETTS Reprinted January 1967 Reprinted June 1967 Reprinted November 1967 Copyright 1965 by Digital Equipment Corporation ii 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 immediately available to each user, eliminating many commonly experienced initial programming delays. The programs described in these abstracts come from two sources, past programming effort on the PDP-5 computer, and present and continuing programming effort on the PDP-8. Thus 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. Consequently, users of either computer can take immediate advantage of the continuing program developments for the other. iii CONTENTS Chapter 2 3 Page INTRODUCTION....................................................... 1-1 FLOATING-POINT REPRESENTATION ................................... . 2-1 Arithmetic ..................................................... " . . 2-4 Basic Floating-Point Commands ....................................... 2-4 Interpreter .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Floating-Point Instructions ........................................... 2-4 FLOATING-POINT INPUT/OUTPUT ..•................................... 3-1 Floating-Point Input ................................................ 3-1 Flags .......•.•.•..••...................................... " . . 3-1 Rubout .............•......................•••••...••.•.•.•..•. 3-2 Floating-Point Output. .. .•• .. .•.••••••.••••••... .•. .•... .•. ..•. .• ... 3-3 Entry. • . . . . . • • . • . . . • . . • . • • • • . . . . . . . . . • • • . . . . . . • . . . . . . . . . . . . . . . . 3-3 Program Example .•.......•.......•..•.•.•.••........•.......... 3-3 The Basic Package ....•.•..•.......•......•......•......•....•...... 3-5 Subroutines •......•.........•.........•...•...•.......•........ 3-5 Description of Basic Function.. . . . . . •. .• ... . ... .••... .. . ... •.. .•. .. .. . 3-6 Addition .•..••••...•..••.•....••••......•.•.•......•.......... 3-6 Subtraction ..•...••••..•.•.•••••...••.•.•.....••......•........ 3-6 Multiplication ...••.••...•.•..•..•.•..........................• 3-6 Division ..........•...•........•.............................. 3-6 Square ...............•..............•...•..........•..•....... 3-7 Square Root .. . . . . • . . . • • . . . . . . . . . • . • . . . . . . . . . . • . . . . . . . • . . . . . . . . . 3-7 Error Flag .....••.•.••.......•.......•......................... 3-7 Summary of Basic Package ......•...............•.................... 3-8 Entry Points ......•.•.•.•..............•..•................. " . . 3-8 Flags .....................•.••.........•...........•..•....... 3-8 Commands .........•........................................... 3-8 Storage ......•........•...........•.....•..................... 3-9 Fixed to Floating/Floating to Fixed Point .............................. 3-9 Extended Floating-Point Package ..................................... 3-10 Sine .......•....•..•... ...••....... ..•...... .... .............. 3-11 v CONTENTS (continued) Chapter 3 (cont) Page ........................................................ 3-11 Arc Tangent ................................................... 3-11 Logarithm ..................................................... 3-12 Floati ng Exponent .............................................. 3-13 .............................................. 3-14 Floating Point Package Versions ...................................... 3-16 Cosine Output Controller 4 PROGRAM LISTINGS ....................•...........•............•..... 4-1 Floating Point Arithmetic Interpreter ....•..•.••..••......•.•...•...••. 4-1 Floating Point I/O Routines... ............. .......................... 4-14 Double Precision Decimal-Binary •.•••••••••.•••••••...•••••.••••.••.• 4-15 Input and Conversion.......... .................................. 4-15 F looting Output "E" Format...................................... 4-17 Floating Point Input ......•.••..•...•.....•........•..••..•...•.. 4-19 Floating Point Package.. . . .. . . . . . . . ... ........ . .... . .. .. .. . ... .... .. 4-23 Floating Point Exponential.... .••.. .•..•.••...••..•..•••••••••••• 4-23 Negation Subroutine ............................................ 4-24 Floating Point Arc Tangent.................................... .•• 4-25 Floating Logarithm.... ... . ...................................... 4-26 Floating Point Sine ............................................. 4-27 Floating Point Cosine ........................................... 4-28 Floating Output Program...... ..... ................ .................. 4-31 VI CHAPTER 1 INTRODUCTION The PDP-8 Floating-Point System enables the programmer to concentrate on the logic of his computation rather than on decimal points. The system maintains a constant number of significant digits throughout the computation, thereby enhancing the accuracy of the result. Floating-point notation is particularly useful for computations involving numerous multiplications and divisions where magnitudes are I ikely to vary widely and where only crude predictions can be made as to the amount of variation involved. The main advantage of the PDP-8 Floating-Point System is derived from the ability to store very large or very small numbers by storing only the significant digits together with the exponent for that number. In an integTal or fractional fixed-point mach ine, the programmer must either include all of the O's between the significant digits and the decimal point (and in so doing loose considerable accuracy), or account for the point in each step of his programming. The PDP-8 Floating-Point System is constructed as a self-contained package which includes its own input, arithmetic, and output routines. It allows the programmer to use floating-point arithmetic without having to construct his own arithmetic subroutines. For example, the polynomial: Y = AX 3 + ax2 + CX + D may be programmed as follows (the variables X and Y, and the parameters A, registers of the same name): JMS FGET FMPY FADD FMPY FADD FMPY FADD FPUT FEXT I 7 A X a X C X D Y /ENTER FLOATING PACKAGE /LOAD PSEUDO AC /MULTIPLY /ADD /MULTIPLY /ADD /MULTIPLY /ADD /STORE /EXIT FLOATING PACKAGE 1.-1 a, C, and D are stored in CHAPTER 2 FLOATING-POINT REPRESENTATION A floating-point number consists of a mantissa and an exponent. For example, the decimal number 12 may be represented as: 1200.0'10- 2 120.00'10- 1 12.000'100 1.2000.10 1 .12000'10 2 etc. where the exponents are the numbers - 2, -1, 0, etc. Since the PDP-8 is a binary machine, floating-point numbers are stored as floating-point binary internally. For example, the binary number 110 (6 decimal) may be represented as: 11000.0.2- 2 (24·1/4 = 6) 1100.00.2- 1 (12·1/2 = 6) 110.000.20 (6·1 = 6) 11.0000.2 1 (3.2=6) 1.10000.l (3/2·4 = 6) .110000.2 3 (3/4'8 = 6) etc. Notice that the binary exponent is always a signed integer. The PDP-8 Floating-Point System uses the convention: 1/2 ~ I MANTISSA I < 1. When this is true, the word is said to be normalized. The value of the number is then: MANTlSSA·2EXPONENT where the MANTISSA is a signed quantity. The result of this convention is that more significant bits are retained. For example, the number. 10 (decimal) is equal to: 2-1 10.00 011 001 100 I 110 011 001 100 I 110 011 001 100 110 ..•• in binary. When this word is stored in two 12-bit words (24 bits), the leading O's are nonsignificant and only 20 bits of significance are maintained. 2- 3 ., 0.11 001 If the number is rewritten as: 100 110 I 011 001 100 110 1011 001 100 110 .... and the mantissa stored in two 12-bit words, 23 bits of significance are maintained. The exponent is stored in a third word making a total of three words for storage. sign of exponent +J binary exponent 2's complement signed quantity sign of mantissa -H high order mantissa word I low order mantissa word The number .1 (decimal) would be stored as: III III III 101 1011001100110 1011001100110 or written in octal: 7775 3146 3146 The address of this number would be considered 2146 if it were stored as follows: 2146/7775 2147/3146 2150/3146 The number -.1 would be: 7775 4631 (double precbion 2 's complement of mantissa) 4632 Since the mantissa is greater (in magnitude) than 1/2 and less than 1, its binary point is considered to be between bit 0 and bit 1 of the high order mantissa word. 2-2 Further examples: 12 (decimal) 1100. = (24) (0.11000000000000000000000) would be stored as (written in octal): 0004 3000 0000 Octal Decimal Floating Binary -1 -1 0001 6000 0000 -10 -8 0004 6000 0000 .4 .5 0000 2000 0000 3 3 0002 3000 0000 14 12 0004 3000 0000 .2 .25 7777 2000 0000 Convert the decimal number 1.6 to PDP-8 floating-binary form for storage. An easy method to convert a decimal fraction to an octal fraction is illustrated below: .6 8 4):8 1.610 = 1 .46314631 8 x x 8 6):'4 x = 1.100110011001100110011001 = (21) (0.11001100110011001100110) 8 3D" = 0001 x 8 1}""7; 3146 8 4~ 3146 8 6).4 8 3;-:2 8 1)":'6 2-3 ARITHMETIC Since floating-point numbers are stored in a three-register format, the floating-point system uses a "psuedo" floating accumulator (FAC) which consists of three registers in the floating-point package: 44, 45, and 46. Register 44 contains the exponent; 45 and 46 contain the high and low order parts of the mantissa, respectively. BASIC FLOATING-POINT COMMANDS The basic floating-point commands include the following: load floating accumulator store floating accumulator add to floating accumulator subtract from floating accumulator multiply by floating accumulator divide into floating accumulator normalize floating accumulator All arithmetic operations are called through an interpreter. The command codes have a format that is almost identical to the format of the PDP-S memory reference instruction, namely: where the op code is from 000 to 111 or Os - 7 S . INTERPRETER The interpreter contains, at all times, the address of the memory location containing the next pseudo instruction to be executed. This is initially stored when the program enters the interpreter using a JMS instruction. When the interpreter encounters an instruction with an op code of 0 and with bits S-11 of the pseudo instruction equal to 0, it exits to the next memory location. FLOATI NG-POI NT I NSTRUCTI ONS The floating-point instructions are: Op Code Mnemonic Effect FADD Floating Addition Add the contents of the effective address to the floating accumulator. 2-4 2 FSUB Floating Subtract Subtract the contents of the effect address from the floating accumu lator. 3 FMPY Floating Multiply Multiply the floating accumulator by the contents of the effective address. 4 FDIV Floating Divide Divide the floating accumulator by the contents of the effecitve address. 5 FGET Floating Get Load the floating accumulator with the contents of the effective address. 6 FPUT Floating Put Store the contents of the floating accumulator at the locations specified by the effective address. The contents of the floating accumu Iator are unchanged. 7 FNOR Floating Normalize Normalize the contents of the floating accumulator. o is decoded as follow~: Bits 8-11 = 0000 Floating Exit Return control to following instruction = 0001 Floating Square Square the contents of the floating accumulator = 0010 Floating Square Root Take the root of the absolute value of the floating accumu lator =0011-1111 Expandable commands This may be summarized: FADD Yi 1000i C(F AC) + C(Y) ~ C(FAC) FSUB Yi 2000i C(FAC) - C(Y) ~ C(FAC) FMPY Yi 3000i C(FAC) x C(Y) -? C(FAC) FDIV Yi 4000i C(F AC) -=: C(Y) -? C(FAC) FGET Yi 5000i C(Y) -? C(FAC) 2-5 Result is C(Y) unchanged FPUT Y; 6000; C(FAC) ~ C(Y) FNOR ; 7000; C(FAC) normalized f,EXT ; 0000; exit from interpreter to instruction following this command ~ C(FAC) SQUARE; 0001; C(FAC)2 ~ C(FAC) SQROOT; 0002; C(FAC) 1/2 ~ C(FAC) The assembler recognizes all of these mnemonics except for SQUARE and SQROOT which may be defined as: S QUARE=OOOl SQROOT=O002 The floating-point interpreter is entered with an effective JMS 5600. For example: SQROOT=OO02 *7 5600 *200 JMS 17 FGET A SQROOT FPUT I B FEXT HLT 0003 A, 2000 0000 300 B, 200/ 201/ 202/ 203/ 204/ 205/ 206/ 207/ 210/ 211/ 4407 5206 0002 6611 0000 7402 0003 2000 0000 0300 $ When this program is started at 0200, it will halt at location 205. The state of the machine will be: 44/ 45/ 46/ 0002 2000 0000 floating accumulator contains 2.0, i.e., (4.0)1/2 206/ 207/ 210/ 0003 2000 0000 register A contains 4.0 300/ 301/ 302/ 0002 2000 0000 answer stored here 2-6 CHAPTER 3 FLOATING-POINT INPUT/OUTPUT FLOATING-POINT INPUT The basic floating-point package contains an input routine to read characters from the 33 ASR keyboard. Numbers are read in in decimal and converted to the internal floating-point binary format. Input format is floating decimal. The number 726.7 may be read in in any of the following forms: 726.7 . 7267E3 . 7267Et<>3 +7267E-1 etc. Input is terminated when a character is typed that is not a part of this format. The conversion of "12.0." would be terminated on the second "." and the binary number: 000000000100 (octal 0004) 011000000000 (octal 3000) 000000000000 (octal 0000) would be in the floating-point accumulator upon completion of the conversion. There are several flags associated with the input routine that are useful to the programmer. 0056 This register is a switch that has the following meaning: If C(56) = 0, do not type a line-feed after a carriage-i"eturn was read. If C(56) = 7777, type a line-feed when a carriage-return is inputted. This switch is initially set to 7777. 0057 This register contains the character that terminated the input conversion. 0060 This register contains 0000 if no input conversion was made; i.e., a space or other terminator was initially typed. 3-1 The input routine is entered with on effective JMS 7400. It returns control to the instruction following the colling JMS upon receipt of a terminator. The floating accumulator contains the input number in normalized floating-binary. Register 0057 contains the terminating character in ASCII, and C(0060) in- dicates whether or not there was a vol id input. For example; *5 7400 *7 5600 *200 JMSI5 JMSI7 FPUT A FEXT JMSI5 JMSI7 FPUT B FEXT HLT /INPUT ROUTINE /CALL FLOATING POI NT A, 0 o B, 0 o o $ When this program is started at 0200 and the following is typed; X2.0Y The program will holt at location 0210, and A and B will contain A, 0 o o B, and C(57) = 0331, the second TERMI NA TOR 0002 2000 0000 The first input was considered a 0 because a terminator "X" was inputted. 3-2 This program could be written to ignore the non-numeric information as follows: *5 7400 *7 5600 *200 /CALL INPUT ROUTINE JMSI5 / ANY VAll D INPUT? TAD 60 SNA CLA JMP .-3 /NO - IGNORE JMSI7 /YES /STORE IT FPUT A FEXT /GET NEXT JMSI5 TAD 60 SNA CLA /VAlID? JMP .-3 /NO - IGNORE JMSI7 /YES FPUT B /STORE IT FEXT HLT /HALT A, 0 o o B, 0 o o $ Register 57 may be used for integrating control characters into the input. Rubout There is one special input character, the rubout. If it is struck before an input delimiter, the input routine is restarted and previous numbers deleted. For example, assume the input routine has been entered. +- ::l 276 ~1T c::: The input routine would exit with 1 (decimal) in the floating accumulator or: 44/ 0001 2000 0000 3-3 FLOATING-POINT OUTPUT The basic floating-point package contains an output routine. Upon entry the contents of the floating accumulator are converted to floating-point decimal and typed out on the ASR 33 in the following format: ±O. XXXXXXXE±XX For example, if the floating accumulator contained: 44/ 0002 2000 0000 and the output routine were entered, t{).2000000Et{)1 would be typed. The output routine is entered by an effective JMS 7200. After outputting the contents of the floating accumulator, it returns control to the instruction following the calling JMS instruction. The contents of the floating accumulator are lost. The floating-output routine has a flag or program switch in location 0055 on page O. If C(0055) does not equal 0, type a carriage-return/line-feed following each output. This location initially contains 7777. Program Example /SOLVE THE QUADRATIC EQUATION / AX 2+ BX+C=O FOR VALUES /OF A, B, C. TYPE OUT ROOTS SQROOT=O002 S QUARE=OOOl *5 7400 /POI NTER TO INPUT ROUTI NE /POI NTER TO OUTPUT ROUTI NE /POI NTER TO INTERPRETER 7200 5600 *200 KCC TLS BEGIN, JMSI5 JMSI7 /INPUT A /ENTER INTERPRETER 3-4 TWO, MIN1, TEMP, A, FMPY TWO FPUT A FEXT JMSI5 JMSI7 FPUT B FEXT JMSI5 JMSI7 Ftv\PY TWO FMPY A FPUT TEMP FGET B SQUARE FSUB TEMP SQROOT FPUT TEMP FGET B FMPY MINl FPUT B FSUB TEMP FDIV A FEXT JMSI6 JMSI7 FGET B FADD TEMP FDIV A FEXT JMSI6 JMP BEGIN 0002 2000 0000 0001 6000 0000 0 0 0 0 /2.0 /STORE 2.0·A /INPUT B /ENTER INTERPRETER /STORE B /INPUT C /ENTER INTERPRETER /MULTIPLY BY 2. /MULTIPLY BY 2A /4AC /B SQUARED /B SQUARED -4AC /TAKE SQUARE ROOT /STORE IT /-l·B=-B /STORE /-B-SQUARE ROOT /ANSWER IN FAC /OUTPUT IT /ENTER INTERPRETER /-B /-B + SQUARE ROOT /ANSWER IN FAC /OUTPUT IT /CONTINUE /CONSTANT 2.0 /CONSTANT -1.0 0 0 B, 0 0 0 C, 0 0 0 $ Both the input-conversion routine and the output-conversion routine use a typeout subroutine that contain~ the Instructions: 3-5 TSF JMP .-1 TLS CLA This means that the teleprinter flag must be set when these routines are entered or it must be in the process of typing. A TLS instruction can be put into the initial ization section of a program. THE BASIC PACKAGE Subroutines When the floating-point interpreter encounters a 0 op code, it further decodes bits 8-11. If these bits equal 0, the interpreter exits. If the bih are nonzero, they are used in a table look-up to specify the address of a subroutine. The called subroutine may use the floating-point interpreter, the input, or the output, but it may not u~e bits 8-11 to call another subroutine. The look-up table is on page 16 of the interpreter listing. For example, if the user wished to define a routine that negated the contents of the floating accumulator, the following ~teps would be taken: On page 6 of the interpreter listing, there is a routine to negate the floating accumulator. It is a subroutine and has, as entry point, the address 6000. If the negate subroutine were to be called by 0010 in the interpreter mode, the word 6000 wou Id be placed in address 6554 of the call ing table. Input and out- put could be called in the interpreter mode if 7400 were placed in 6555 (0011) and 7200 were placed in 6556 (0012). NEGATE = 0010 INPUT = 0011 OUTPUT = 0012 SQUARE = 0001 *7 5600 *200 KCC TLS JMSI7 INPUT SQUARE NEGATE OUTPUT FEXT HLT /ENTER INTERPRETER /CALL INPUT ROUTINE /SQUARE IT /CALL OUTPUT ROUT! NE /CALL OUTPUT ROUTI NE /EXIT /HALT $ 3-6 DESCRIPTION OF BASIC FUNCTION Addition Floating-point addition is carried out by first aligning the binary points of the two numbers. This is accomplished by scaling the smaller number to the right. Then the mantissas are both scaled right once 50 that overflow wi II not occur into the sign bit. A 2 1s complement addition of the mantissas is then made. The result is normalized and control returns to the interpreter. This may be represented as: Can operands be aligned? + Yes Align Exponents Add Mantissas Normalize Return to Interpreter No Put larger number in FAC I <l1li<l1li1-------.... Subtraction Floating-point subtraction is accomplished by negating the operand, and then calling .the addition subprogram. Negate Operand Call Addition Multiplication Floating-point multiplication is accomplished by adding the exponents together and then performing a double-precision multiplication. The result h normalized and control returns to the interpreter. Add Exponents Multiply Mantissas carrying result to 35 bits Normalize Return to Interpreter Division Floating-point division is accomplished by subtracting the exponent of the divisor from the exponent of the dividend. The mantissa is divided and the result is normalized. Control returns to the interpreter. 3-7 Is divisor = O? • No Yes Subtract Exponents Divide Mantissas Normalize Return to interpreter • + 1 to error fl ag Set resrlt to highest possible The ~quare routine calls the mu Itipl ication routine internally. Square Root The square root is calculated using Newton's method in which an initial approximation is made and then each succeeding approximation is calculated. The routine exits when two successive approximations are equal to within the least significant bit of the mantissas. Form first approximation, Xl' of .,t'N';" then: N X.+1 = 1/2 (X. + -X ) I is I . I IXi - Xi +1 I < least significant bit? ~-~o ! Yes Return to interpreter Error Flag Division by 0 causes C(61) to be incremented by 1. The quotient is set to the highest positive number. Attempting to extract the square of a negative number causes C(61) to be incremented by 1. The root of the absolute value is taken. Thecontentsof61 are set to 0 at the beginning of each divide and square root operation. 3-8 SUMMARY OF BASIC PACKAGE Entry Points 5600 Arithmetic Interpreter 7400 Floating Input 7200 Floating Output NOTE: Both the input and the output routines require that register 7 contains the interpreter entry point: 5600. 55 If 10, type carriage-return/line-feed after output. 56 If 10, follow each input carriage-return by a line-feed. 57 Contains the input terminating character. 60 Equals 0 if no val id input. 61 Is nonzero if (a) divide by 0 or (b) square root of a negative number. Commands FADD 1000 Floating Add FSUB 2000 Floating Subtract FMPY 3000 Floating Multiply FDIV 4000 Floating Divide FGET 5000 Floating Get FPUT 6000 Floating Put FNOR 7000 Floating Normalize FEXT 0000 Floating Exit SQUARE 0001 Square SQROOT 0002 Square Root 0003 Expandable 0017 3-9 Storage The floating accumulator is in registers: 44 - Exponent 45 - High Order Mantissa 46 - Low Order Mantissa The basic floating-point package (Digital 8-5A-S) uses memory locations: 7; 40-61; 5600-7577 FIXED TO FLOATING/FLOATING TO FIXED Since the floating-point package stores numbers in the following format: Signed Exponent " ,J 2 1s Complement Signed Mantisa llmplied Binary Point and ~ince the exponent indicates where the real exponent is, this information may be used to either convert a floating-point number to fixed point or to convert a fixed-point number to floating point. For example, assume that there is an integer in the accumulator that is less in magnitude than 2047. To float this number, the following sequence of deps may be employed: C, DCA 45 DCA 46 TAD C13 DCA 44 JMSI7 FNOR FEXT /PUT INTO HIGH-ORDER MANTISSA /PUT 0 INTO LOW-ORDER MANTISSA /11 (10) INTO /EXPONENT /CALL INTERPRETER /NORMALIZE /LEAVE INTERPRETER C13, 0013 /11 (DECIMAL) At point C, we have set the binary point of the integer to the right end of the high order mantissa word, or eleven (decimal) locations to the right of the implicit binary point. To float this number, the floating accumulator is scaled right until the exponent contains the location of the desired binary point. To fix the floating accumulator as an ll-bit signed integer, the following sequence of coding may be employed: 3-10 DONE, CLA TAD 44 SZA SMA JMP .+3 CLA JMP DONE+l TAD M13 SNA JMP DONE SMA JMP ERROR DCA 44 CLL TAD 45 SPA CML RAR DCA 45 ISZ 44 JMP 00 TAD 45 M13, -13 GO, IFETCH EXPONENT liS THE NUMBER <1? INO: IYES: FIX IT TO 0 INO: SET BINARY POINT AT III (10) PLACES TO RIGHT OF CURRENT POINT liT IS ALREADY THERE: ALL DONE ITEST TO SEE IF IT IS TOO LARGE IYES: NUMBER >2**1) INO: SET SCALE COUNT 10 TO C(L} IFETCH MANTISSA lis IT <O? IYES: PUT A I IN LEFT BIT ISCALE RIGHT IRESTORE IT ITEST IF SHIFTED ENOUGH INO: CONTI NUE I ANSWER IN C(AC) 1-11 (DECIMAL) This may be coded as a subroutine. EXTENDED FLOATING-POINT PACKAGE The extended floating-point package contains the following additional commands: 0003 Floating Sine Take the sine of the angle in the floating accumulator (considered to be in radians) and leave the result in the floating accumulator. 0004 Floating Cosine Take the cosine of the angle in the floating accumulator (considered to be in radians) and leave the result in the floating accumulator. 0005 Floating Arc Tangent Take the arc tangent of the number in the floating accumulator and leave the resu It (in radians) in the floating accumu lator. 0006 Floating Exponent Raise e to the C(FAC) power. Leave the result in the floating accumulator . .0007 Floating Logarithm Take the natural logarithm of the absolute value of the number in the floating accumu lator. 3-11 Sine The sine routine uses the following identities: SIN(-X)=-SIN(X) SI N(X)=51 N(2 IT N+F)=51 N(F) where O<F<2lTand N is an integer: 51 N(lT -F)=-51 N(F) Using these identities, F is reduced to the range -IT/2<F<1V'2. If Y = 2F/lT so that -1 <F<l , then: 51 N(X)=(C 1F+Cl 3+C5 F5 +Cl7+C9F9) where: C 1 = 1.57079631847 C3 = -0.64596371106 C5 = +0.07968967928 C7 = -0.00467376557 C9 = +0.00015148419 The sine subroutine is valid over the range: -2lT.2047<X<2lT.2047 Cosine The cosine routine uses the identity: C05(X)=51 N(lT /2-X) I t then uses the 5 I NE routi ne . Arc Tangent The arc tangent routine uses the following identities: ARCTAN (-X)=-ARCT AN(X) IF X>, 1; then ARCTAN(X)=lT/2-ARCTAN(l/X) FOR 0<X<1, 3-12 where: Aa = +0.6402481953 A1 = +0.4229908144 A2 = +0.0264694361 BO = +0.6402487022 B1 = +0.6363779373 B2 = +0. 1108328778 The result is in the range: -1T /2<ARCTAN (X)< 1T/2 -oo<X<oo Logarithm The logarithm routine uses the identities: For X<l; LOG(X)=LOG(2 N . F) (l<F<2) =NLOG(2)+LOG(F) 8 LOG(l+Y)= L C=l where: A1 = +0.9999964239 A2 = -0.4998741238 A3 = +0.3317990258 A4 = +0.2407338084 A5 = +0.1676540711 A6 = -0.0953293897 3-13 ~ = +0.0360884937 Aa = -0.0064553442 for: 0<X<1, the identity: LOG(X)=-LOG(l/X) is used. Floating Exponent The exponent routine uses the identity for X)(), where N is an integer and <F<l l =1 + _ _2_F_ __ C_ A-F+BF2 _ _ D+F 2 where: A = +9.95459578 B = +0.03465735903 C =+617.97226053 D =+87.417497202 Log 2e=1.4426950409 If X<O x 1 e =--x e Example, input A, B, and output: Y = LOG(COS(A/B)+I'A'=B) SQROOT=O002 COS=0004 LOG=0006 /DEFINITIONS TO ASSEMBLER *5 7400 7200 5600 /USES EXTENDED INTERPRETER 3-14 *200 KCC TLS BEGI N, A, B, TEMP, s JMS I 5 JMSI7 FPUT A FEXT JMSI5 JMSI7 FPUT B FMPY A SQROOT FPUT TEMP FGET A FDIV B COS FADD TEMP LOG FEXT JMSI6 JMP BEGIN /INPUT A /ENTER INTERPRETER /STORE A /EXIT /INPUT B /ENTER INTERPRETER /STORE B /A'B /EXTRACT ROOT /STORE IT /LOAD FAC WITH A /DIVIDE BY B /TAKE COSINE /ADD /TAKE LOG. /OUTPUT ANSWER a a a a a a a a a Output Controller There is an additional routine available that formats floating-point output. It is available with both the basic floating-point package and the extended package. The controller routine requires two parameters for output formatting. It is called by an effective JMS7200. At this point: C(62) = total number of digits to be outputted. If C(62)=O, output in E format. C(AC) = number of digits to the right of the decimal point. If it equals 0, do not type a ".". If the number in the floating accumulator is larger than the field width allows, "XIS" will be typed. The sign is typed and leading OIS are suppressed. Example: If the contents of the flodting accumulator are 678.234 (decimal). 3-15 C(62) C(AC) Output 3 4 4 5 6 3 2 0 0 0 1 2 2 2 0 1 + 678 + 678 + 678.2 + 678.23 + 678.23 + 678. +XX + 0.678234E+OJ FLOATING POINT PACKAGE VERSIONS Four versions of the floating-point package are available: Digital 8-5A-S This is the basic floating-point package. It consists of the input/output package and the basic arithmetic instructions. Its core limits are: 7; 40-61; 5600-7577 Digital 8-58-S This is the bClsic floating-point package with the output controller. Its limits are: 7; 40-62; 5400-7577 The output controller does not type a carriage-return/line-feed after output and, hence, the programmer must provide his own routine to do so. Because of the way in which the typeout routine in the floatingpoint packages are constructed, the user must construct similar typeout routines in order to avoid timing errors in the teleprinter. In other words, the floating-point package uses a routine simi lar to: TSF JMP .-1 TLS to do its typing. The user must use a similar routine, i.e., one that waits for the teleprinter flag to be set before executing the TLS instruction. Digital 8-5C-S This is the basic floating-point package with the extended functions. In addition, two interpretive commands are provided for input and output. The additional interpret ive commands are: 3-16 SINE COSINE ARCTANGENT EXPONENTIAL LOG INPUT OUTPUT 3 4 5 6 7 13 14 Its core limits are: 7; 40-61; 4757-7577 Using this package, the routine on page 3-14 and 3-15 for calculating: Y=LOG(COS(A/B)+ IA-B) may be rewritten as: SQROOT=2 FCOS=4 FLOG=6 INPUT=13 OUTPUT=14 *7 5600 *200 KCC TLS BEGI N, A, B, TEMP, JMSI7 /CALL INTERPRETER INPUT /READ A FPUT A /STORE IT INPUT /READ B FPUT B FMPYA /A·B SQROOT FPUT TEMP /(A· B)** .5 FGET A FDIV B FCOS FADD TEMP FLOG OUTPUT FEXT JMP BEGIN o o o o o o o o o $ 3-17 ~igital 8-50-5 This is the basic package, the output controller, and the extended functions. Its core limits are: 7; 40-62; 4557-7577 3-18 CHAPTER 4 PROGRAM 0040 0041 0042 0043 0044 0045 0046 0047 0050 0051 0052 0053 0054 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0061 0000 5600 5601 5602 5603 5604 5605 5606 5607 5610 5611 5612 5613 5614 5615 5616 5617 5620 5621 5622 5623 5624 5625 5626 5627 5630 5631 5632 0000 7300 3043 3047 1600 3253 1253 0263 7650 5214 1261 0200 3256 1262 0253 1256 3256 1264 0253 7650 5227 1656 3256 2200 1656 3040 1256 LISTINGS /FlOATING POINT ARITHMETIC INTERPRETER *40 EX1, 0 /OPERAND STORAGE AC1H, 0 AC1 l, 0 OVER 1, 0 EXP, 0 /F.A. HaRD, 0 lORD, 0 OVER2, 0 EXP1, 0 QUal, 0 FPAC1, 0 0 0 *61 FLAG, /ARITHMETIC ERROR FLAG 0 *5600 FPNT, lOOP01, 0 ClA Cll DCA OVER1 DCA OVER2 TAD I FPNT DCA JUMP TAD JUMP AND PAGENO SNA ClA JMP .+3 TAD MASK5 AND FPNT DCA ADDR TAD MASK7 AND JUMP TAD ADDR DCA ADDR TAD INDRCT AND JUMP SNA ClA JMP lOOP01 TAD I ADDR DCA ADDR ISZ FPNT TAD I ADDR DAC EX1 TAD ADDR /GET NEXT INSTRUCTION /GET PAGE BIT /PAGE ZERO? /YES /NO /C(FPNT)O-4 CONTAINS PAGE BITS /GET 7 BIT ADDRESS /INDIRECT BIT=1? /NO-GO ON /YES DEFER /EXPONENT 4-1 5633 5634 5635 5636 5637 5640 5641 5642 5643 5644 5645 5646 5647 5650 5651 5652 5653 5654 5655 5656 5657 5660 5661 5662 5663 5664 5665 5666 5667 5670 5671 5672 5673 5674 5675 5676 5677 5700 5701 5702 5703 5704 5705 5706 5707 5710 5711 5712 5713 5714 5715 5716 5717 5720 3257 2257 1657 3041 2257 1657 3042 1253 7106 7006 0260 1265 3254 1654 3254 5654 0000 0000 0000 0000 0000 0017 7600 0177 0200 0400 5666 5742 5716 5737 5761 6305 5676 5705 5773 1040 3044 1041 3045 1042 3046 5201 1044 3656 2256 1045 3656 2256 1046 3656 5201 4771 5201 4772 JUMP, JUMP2, G02, ADDR, SAVE, MASK3, MASK5, MASK7, PAGENO, INDRCT, TABLE, FlGT, FlPT, FlAD, DCA SAVE ISZ SAVE TAD 'SAVE DCA AC1H ISZ SAVE TAD I SAVE DAC AC1l TAD JUMP Cll RTl RTl AND MASK3 TAD TABLE DCA JUMP2 TAD I JUMP2 DCA JUMP2 JMP I JUMP2 0 0 0 0 0 0017 7600 0177 0200 0400 .+1 EXIT FlAD FlSU FlMY FlDV FlGT FlPT NORF TAD EXl DCA EXP TAD AC1H DCA HORD TAD ACll DCA lORD JMP FPNT+1 TAD EXP DCA I ADDR ISZ ADDR TAD HORD DCA I ADDR ISZ ADDR TAD lORD DCA I ADDR JMP FPNT+1 JMS I AlGN JMP FPNT+1 JMS I UNORM /HIGH ORDER MANTISSA flOW ORDER MANTISSA /GET BITS 0-2, IE OPCODE /lOOKUP IN TABLE /GO THERE /TABlE USED IN INTERPRETING /BITS 0-2 OF PSEUDO /INSTRUCTION /IF OPCODE=O, GO TO EXIT /AND INTERPRET BITS 8-11 /FGET=5 /FPUT=6 /FlAD=l - FIRST ALIGN EXPONENTS /RETURN IF NO ALIGNMENT IS POSSIBLE /lARGER OF THE TWO IS IN F.A. 4-2 5721 5722 5723 5724 5725 5726 5727 5730 5731 5732 5733 5734 5735 5736 7100 1043 1047 3047 7004 1042 1046 3046 7004 1041 1045 3045 4770 5201 5737 5740 5741 5742 5743 5744 5745 5746 5747 5750 5751 5752 5753 5754 5755 5756 5757 5760 5761 5762 5763 5764 5765 5766 5767 5770 5771 5772 5773 5774 4741 5316 6400 1253 0260 7450 5600 1360 3254 1654 3254 1200 3255 4654 1255 3200 5201 6544 7201 1040 1044 3044 4767 5201 6221 6600 6020 6564 4770 5201 6000 6001 6002 6003 6004 6005 6006 6007 0000 7300 1047 7041 3047 1046 7040 7430 Cll TAD OVER1 TAD OVER2 DCA OVER2 RAl TAD AC1l TAD lORD DCA lORD RAl TAD AC1H TAD HORD DCA HORD JMS I NORM JMP FPNT+1 FlSU, OPMINS, EXIT, ACON6, FlMY, MUlT, NORM, AlGN, UNORM, NORF, *6000 ACMINS, /TRIPlE PRECISION ADDITION /SINCE BITS ARE SHIFTED /RIGHT /NORMALIZE THE RESULT JMS I OPMINS JMP FlAD MINUS2 TAD JUMP AND MASK3 SNA JMP I FPNT TAD ACON6 DCA JUMP2 TAD I JUMP2 DCA JUMP2 TAD FPNT DCA G02 JMS I JUMP2 TAD G02 DCA FPNT JMP FPNT+1 TABlE6-1 ClAIAC TAD EX1 TAD EXP DCA EXP JMS I MUlT JMP FPNT+1 DMUlT DNORM ALIGN DUNORM JMS I NORM JMP FPNT+1 /FSUB=2 - NEGATE THE OPERAND /ADD 0 Cll ClA TAD OVER2 CMA lAC DCA OVER2 TAD LORD CMA SZL /ROUTINE TO PERFORM /OPCODE=O /ARE BITS 8-11=0? /YES=FEXT /lOOKUP ON TABLE /CAll AS A SUBROUTINE /RESTORE F.P. POINTER /GET NEXT PSEUDO INSTRUCTION /CAlLiNG CAN BE TO A DEPTH ONE /FMPY=3 /ADD EXPONENTS TOGETHER /MUlTIPlY /TRIPlE PRECISION NEGATION /OF FLOATING AC 4-3 6010 6011 6012 6013 6014 6015 6016 6017 6020 6021 6022 6023 6024 6025 6026 6027 6030 6031 6032 6033 6034 6035 6036 6037 6040 6041 6042 6043 6044 6045 6046 6047 6050 6051 6052 6053 6054 6055 6056 6057 6060 6061 6062 6063 6064 6065 6066 6067 6070 6071 6072 6073 6074 6075 7101 3046 1045 7040 7430 7101 3045 5600 0000 1045 7640 5227 1046 7650 5337 1041 7640 5235 1042 7650 5620 1040 7041 1044 7450 5314 7500 7041 3342 1342 1343 7700 5256 4316 7430 1350 1347 5325 4316 7420 1350 1347 3344 1342 7041 1744 3744 2344 1344 3345 2345 1345 3346 2346 ALIGN, CLL lAC DCA LORD TAD HORD CMA SZL CLL lAC DCA HORD JMP I ACMINS 0 TAD HORD SZA CLA JMP .+4 TAD LORD SNA CLA JMP NOHERE TAD AC1H SZA CLA JMP .+4 TAD AC1L SNA CLA JMP I ALIGN TAD EX1 CMA lAC TAD EXP SNA JMP DONE SMA CMA lAC DCA AMOUNT TAD AMOUNT TAD TEST2 SMA CLA JMP .+6 JMS OUTGO SZL TAD TAG2 TAD TAG1 JMP NOGO JMS OUTGO SNL TAD TAG2 TAD TAG1 DCA TEST3 TAD AMOUNT CMA lAC TAD I TEST3 DCA I TEST3 ISZ TEST3 TAD TEST3 DCA TEST4 ISZ TEST4 TAD TEST4 DCA TEST5 ISZ TEST5 4-4 ISUBROUTINE TO ALIGN IBINARV POINTS FOR ADD-SUBTRACT I liS MANTISSA ZERO? /yES liS OPERAND ZERO? IBOTH ARE ZERO-EXIT I ARE EXPONENTS EQUAL? IVES ICAN EXPONENTS BE ALIGNED? IVES INO ISET UP ADDRESSES 6076 6077 6100 6101 6102 6103 6104 6105 6106 6107 6110 6111 6112 6113 6114 6115 6116 6117 6120 6121 6122 6123 6124 6125 6126 6127 6130 6131 6132 6133 6134 6135 6136 6137 6140 6141 6142 6143 6144 6145 6146 6147 6150 6151 6152 6153 6154 6155 6156 6157 6160 6161 6162 7100 1744 7510 7020 7010 3744 1745 7010 3745 1746 7010 3746 2342 5276 2220 5620 0000 1040 7041 1044 7004 SHIFT, DONE, OUTGO, 7200 5716 3344 1744 3044 2344 1744 3045 2344 1744 3046 5620 1040 3044 5314 0000 0030 0000 0000 0000 0044 7774 5601 1362 3044 1362 3045 7040 3046 2061 5751 3777 NOGO, NOHERE, AMOUNT, TEST2, TEST3, TEST4, TEST5, TAG1, TAG2, RETN2, ERROR1, GOOF, CLL TAD I TEST3 SPA CML RAR DCA I TEST3 TAD I TEST4 RAR DCA I TEST4 TAD I TEST5 RAR DCA I TEST5 ISZ AMOUNT JMP SHIFT ISZ ALIGN JMP I ALIGN 0 TAD EXl CMA lAC TAD EXP RAL CLA JMP I OUTGO DCA TEST3 TAD I TEST3 DCA EXP ISZ TEST3 TAD I TEST3 DCA HORD ISZ TEST3 TAD I TEST3 DCA LORD JMP I ALIGN TAD EXl DCA EXP JMP DONE 0 0030 0 0 0 EXP EX1-EXP FPNT+l TAD GOOF DCA EXP TAD GOOF DCA HORD CMA DCA LORD ISZ FLAG JMP I RETN2 3777 /THIS ROUTINE DOES /THE ACUTAL SHIFTIN G /DETERMINE WHICH TO SHIFT /CAN'T BE ALIGNED /LARGEST GOES INTO FAC /MANTISSA=O /DIVISION BY ZERO /SET TO LARGEST + VALUE /SET FLAG 4-5 6163 6164 6165 6166 6167 6170 6171 6172 0000 4407 6052 3052 0000 5763 0000 5771 6200 6201 6202 6203 6204 6205 6206 6207 6210 6211 6212 6213 6214 6215 6216 6217 6220 6221 6222 6223 6224 6225 6226 6227 6230 6231 6232 6233 6234 6235 6236 6237 6240 6241 6242 6243 6244 6245 6246 6247 6250 6251 6252 6253 0000 7300 1045 7510 7120 7010 3045 1046 7010 3046 1047 7010 3047 7100 2044 7000 5600 0000 7300 1363 3347 4336 1042 3756 1046 4755 7200 1757 3047 1045 3756 1042 4755 1047 3047 7004 1757 3367 7004 3370 1041 3756 1046 4755 SQUARE, EXIT6, *6200 DIV1, DMUlT, 0 JMS 10007 FPUT FPACl FMPY FPACl FEXT JMP I SQUARE 0 JMP I EXIT6 /DUMMY SUBROUTINE 0 ClA Cll TAD HaRD SPA Cll CMl RAR DCA HaRD TAD lORD RAR DCA lORD TAD OVER2 RAR DCA OVER2 Cll ISZ EXP Nap JMP I DIV] 0 ClA Cll TAD SMAClA DCA SNSWIT JMS SIGN TAD ACl l DCA I MP2PT TAD lORD JMS I MP4PT ClA TAD I MP5PT DCA OVER2 TAD HaRD DCA I MP2PT TADACll JMS I MP4PT TAD OVER2 DCA OVER2 RAl TAD I MP5PT DCA D RAl DCA KEEP TAD AC1H DCA I MP2PT TAD lORD JMS I MP4PT /SHIFT FAC RIGHT /DOUBlE PRECISION MULTIPLY /SAVE PRODUCT TRIPLE PRECISION /CAllS A SINGLE PRECISION /MUlTIPl Y 3 TIMES 4-6 6254 6255 6256 6257 6260 6261 6262 6263 6264 6265 6266 6267 6270 6271 6272 6273 6274 6275 6276 6277 6300 6301 6302 6303 6304 6305 6306 6307 6310 6311 6312 6313 6314 6315 6316 6317 6320 6321 6322 6323 6324 6325 6326 6327 6330 6331 6332 6333 6334 6335 6336 6337 6340 1047 3047 7004 1757 1367 3367 7004 1370 3370 1045 3756 1041 4755 1367 3046 7004 1757 1370 3045 4760 3047 2365 5621 4773 5621 1041 7640 5313 1042 7650 5774 1040 7041 1044 7001 3044 1362 3347 4336 4761 1757 1041 7630 7001 3042 3041 2365 4773 5735 5720 0000 1366 3365 FLDV, SIGN, TAD OVER2 DCA OVER2 RAL TAD I MP5PT TAD D DCA D RAL TAD KEEP DCA KEEP TAD HORD DCA I MP2PT TAD AC1H JMS I MP4PT TAD D DCA LORD RAL TAD I MP5PT TAD KEEP DCA HORD JMS I NORMF DCA OVER2 ISZ SGN JMP I DMULT JMS I MINS JMP I DMULT TAD AC1H SZA CLA JMP .+4 TAD ACl L SNA CLA JMP I ERROR TAD EXl CMA lAC TAD EXP lAC DCA EXP TAD SPACLA DCA SNSWIT JMS SIGN JMS I DIVIDE TAD I MP5PT TAD AC1H SZL CLA lAC DCA ACl L DCA AC1H ISZ SGN JMS I MINS JMP I .+1 FLAD+2 0 TAD REST DCA SGN /DIVISION BY ZERO /SUBTRACT EXPONENTS /SET UP SIGNS /DIVIDE /ROUND OFF IN 23RD BIT /TEST SIGN /NEGATE ~DD ROUNDING /TEST SIGN OF RESUL T /SET UP BY MULTI PL Y AN D /DIVIDE 4-7 6341 6342 6343 6344 6345 6346 6347 6350 6351 6352 6353 6354 6355 6356 6357 6360 6361 6362 6363 6364 6365 6366 6367 6370 6371 6372 6373 6374 1045 7700 5346 4773 2365 1041 7700 5736 4771 2365 7000 5736 6437 6471 6465 6600 6472 7710 7700 5601 0000 7776 0000 0000 6400 6420 6000 6152 6400 6401 6402 6403 6404 6405 6406 6407 6410 6411 6412 6413 6414 6415 6416 6417 6420 6421 6422 6423 6424 6425 6426 6427 0000 7300 1043 7041 3043 1042 7040 7430 7101 3042 1041 7040 7430 7101 3041 5600 0000 7300 1041 7510 7120 7010 3041 1042 SNSWIT, MP4PT, MP2PT, MP5PT, NORMF, DIVIDE, SPAClA, SMAClA, RETURN, SGN, REST, 0, KEEP, MINS2, RAR2, MINS, ERROR, *6400 MINUS2, DIV2, TAD HORD SMA ClA JMP .+3 JMS I MINS ISZ SGN TAD AC1H SMA ClA JMP I SIGN JMS I MINS2 ISZ SGN NOP JMP I SIGN MP4 MP2 MP5 DNORM DUBDIV SPA ClA SMA ClA FPNT+l 0 7776 0 0 MINUS2 DIV2 ACMINS ERRORl lOR SPA ClA I-AC1H,ACll I ACl H, ACl L/2 0 ClA Cll TAD OVERl CMA lAC DCA OVERl TAD ACll CMA SZl Cll lAC DCA ACll TAD AC1H CMA SZl Cll lAC DCA AC1H JMP I MINUS2 0 ClA Cll TAD AC1H SPA Cll CMl RAR DCA AC1H TAD ACl l INEGATE OPERAND ITRIPlE PRECISION ISH 1FT OPERAND RIGHT ITRIPlE PRECISION 4-8 6430 6431 6432 6433 6434 6435 6436 6437 6440 6441 6442 6443 6444 6445 6446 6447 6450 6451 6452 6453 6454 6455 6456 6457 6460 6461 6462 6463 6464 6465 6466 6467 6470 6471 6472 6473 6474 6475 6476 6477 6500 6501 6502 6503 6504 6505 6506 6507 6510 6511 6512 6513 6514 7010 3042 1043 7010 3043 7100 5620 0000 3266 3265 1270 3267 7100 1266 7010 3266 1265 7420 5255 7100 1271 7010 3265 2267 5245 1266 7010 7100 5637 0000 0000 0000 7764 0000 0000 7300 3051 1344 3267 5306 1046 7004 3046 1045 7004 3045 1042 1046 3271 7004 1045 1041 7420 MP4, MP5, MP1, MP3, THIR, MP2, DUBDIV, DV3, DVX, RAR DCA AC1 l TAD OVER1 RAR DCA OVER1 Cll JMP I DIV2 0 DCA MP1 DCA MP5 TAD THIR DCA MP3 Cll TAD MP1 RAR DCA MP1 TAD MP5 SNl JMP .+3 Cll TAD MP2 RAR DCA MP5 ISZ MP3 JMP MP4+6 TAD MP1 RAR Cll JMP I MP4 0 0 0 7764 /SINGlE PRECISION MULTIPLY /12 BITS BY 12 BITS a 0 ClA Cll DCA QUOl TAD MIF DCA MP3 JMP DVX TAD lORD RAl DCA lORD TAD HaRD RAl DCA HORD TAD AC1l TAD lORD DCA MP2 RAl TAD HaRD TAD AC1H SNl /DOUBlE PRECISION DIVIDE 4-9 6515 6516 6517 6520 6521 6522 6523 6524 6525 6526 6527 6530 6531 6532 6533 6534 6535 6536 6537 6540 6541 6542 6543 6544 6545 6546 6547 6550 6551 6552 6553 6554 6555 6556 6557 6560 6561 6562 6563 5321 3045 1271 3046 7200 1051 7004 3051 1047 7004 3047 2267 5300 1051 3046 1045 7106 3265 1047 3045 3047 1265 5672 7751 6163 6656 6171 6171 6171 6171 6171 6171 6171 6171 6171 6171 6171 6171 6171 6564 6565 6566 6567 6570 6571 6572 0000 4220 4772 2040 7000 5764 6200 6600 6601 6602 6603 6604 6605 0000 7300 3255 3254 1045 7510 DV2, MIF, TABLE6, DUNORM, RAR1, *6600 DNORM, JMP DV2-1 DCA HORD TAD MP2 DCA LORD CLA TAD QUOL RAL DCA QUOL TAD OVER2 RAL DCA OVER2 ISZ MP3 JMP DV3 TAD QUOL DCA LORD TAD HORD CLL RTL DCA MP5 TAD OVER2 DCA HORD DCA OVER2 TAD MP5 JMP I DUBDIV 7751 SQUARE SQROOT EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 EXIT6 /TABLE FOR INTERPRETATION /OF BITS 8-11 /CONTAINS ABSOLUTE ADDRESSES /OF PROGRAMS CALLED AS /SUBROUTINES /EXIT6=A DUMMY OR NOP 0 JMS DIV2 JMS I RAR1 ISZ EX1 NOP JMP I DUNORM DIV1 /SHIFT OPERAND RIGHT /SUBROUTINE TO NORMALIZE /FLOATING ACCUMULATOR 0 CLA CLL DCA AMTl DCA SIGN1 TAD HORD SPA /15 MANTISSA NEGATIVE? 4-10 6606 6607 6610 6611 6612 6613 6614 6615 6616 6617 6620 6621 6622 6623 6624 6625 6626 6627 6630 6631 6632 6633 6634 6635 6636 6637 6640 6641 6642 6643 6644 6645 6646 6647 6650 6651 6652 6653 6654 6655 6656 6657 6660 6661 6662 6663 6664 6665 6666 6667 6670 6671 6672 6673 2254 7640 5217 1046 7640 5217 1047 7650 5251 1254 7640 4653 1045 7104 7710 5241 1047 7104 3047 1046 7004 3046 1045 7004 3045 2255 5222 1255 7041 1044 3044 1254 7640 4653 5600 3044 5600 6000 0000 0000 0000 3362 4407 6052 0000 1045 7710 5351 1044 7100 7510 7020 7010 3356 G06, lOP, EXITl , EXIT2, NEG, SIGN1, AMTl, SQROOT, ISZ SIGNl SZA ClA JMP G06 TAD lORD SZA ClA JMP G06 TAD OVER2 SNA ClA JMP EXIT2 TAD SIGNl SZA ClA JMS I NEG TAD HORD RAl Cll SPA ClA JMP EXITl TAD OVER2 Cll RAl DCA OVER2 TAD lORD RAl DCA lORD TAD HORD RAl DCA HORD ISZ AMTl JMP lOP TAD AMTl CMA lAC TAD EXP DCA EXP TAD SIGNl SZA ClA JMS I NEG JMP I DNORM DCA EXP JMP I DNORM ACMINS 0 0 0 DCA FlAGl JMS 1007 FPUT FPACl FEXT TAD HORD SPA ClA JMP SQENDl TAD EXP Cll SPA CMl RAR DCA ITERl /YES /IS MANTISSA=O? /NO /YES /NO /NEGATlVE? /YES /Wlll SHIFT BE TOO FAR? /YES /NO SHIFT MANTISSA lEFT /COUNT NO. OF TIMES SH IFTED /CORRECT EXPONENT /NEGATlVE? /YES /SET TO ZERO /FlOATING SQUARE ROOT /TAKES ROOT OF ABSOLUTE /VAlUE /NEWTON'S METHOD IS USED /NUMBER IS NEGATIVE /MAKE FIRST APPROXIMATION 4-11 6674 6675 6676 6677 6700 6701 6702 6703 6704 6705 6706 6707 6710 6711 6712 6713 6714 6715 6716 6717 6720 6721 6722 6723 6724 6725 6726 6727 6730 6731 6732 6733 6734 6735 6736 6737 6740 6741 6742 6743 6744 6745 6746 6747 6750 6751 6752 6753 6754 6755 6756 6757 6760 6761 6762 7430 2356 7000 1361 3357 3360 1053 7640 5310 1054 7650 5354 4407 5052 4356 1356 0000 7240 1044 3044 1044 7041 1356 7640 5345 1045 7041 1357 7640 5345 1046 7041 1360 7500 7041 7001 7710 5345 1362 3061 5656 4407 6356 0000 5310 4653 2362 5260 3044 5656 0000 0000 0000 3015 0000 CLCU, ROOTGO, SQEND1, SQEND, ITER1, SQCON1, FLAG1, SZL ISZ ITER1 NOP TAD SQCON1 DCA ITER1+1 DCA ITER1+2 TAD FPAC1+1 SZA CLA JMP CLCU TAD FPAC1+2 SNA CLA JMPSQEND JMS 10007 FGET FPAC1 FDIV ITER1 FADD ITER1 FEXT CLA CMA TAD EXP DCA EXP TAD EXP CMA lAC TAD ITER1 SZA CLA JMP ROOTGO TAD HORD CMA lAC TAD ITER1+1 SZA CLA JMP ROOTGO TAD LORD CMA lAC TAD ITER1+2 SMA CMA lAC lAC SPA CLA JMP ROOTGO TAD FLAG1 DCA FLAG JMP I SQROOT JMS 10007 FPUT ITER1 FEXT JMP CLCU JMS I NEG ISZ FLAG1 JMP SQROOT+2 DCA EXP JMP I SQROOT 0 0 0 3015 0 4-12 INUMBER=O I ARE EXPONENTS EQUAL? INO IARE HIGH-ORDER MANTISSAS EQUAL? INO IDO LOW-ORDER MANTISSAS AGREE? /WITHIN ONE BIT? INO INEGATE FAC ACMINS ACON6 AC1H AClL ADDR ALGN ALIGN AMOUNT AMT1 CLCU D DIVIDE DIV1 DIV2 DMULT DNORM DONE DUBDIV DUNORM DVX DV2 DV3 ERROR ERROR1 EXIT EXITl EXIT2 EXIT6 EXP EXP1 EX1 FLAD FLAG FLAG1 FLDV FLGT FLMY 6000 5760 0041 0042 5656 5771 6020 6142 6655 6710 6367 6361 6200 6420 6221 6600 6114 6472 6J64 6506 6522 6500 6374 6152 5742 6641 6651 6171 0044 0050 0040 5716 0061 6762 6305 5676 5761 FLPT FLSU FPAC1 FPNT GOOF G02 G06 HORD INDRCT ITER1 JUMP JUMP2 KEEP LOOP01 LOP LORD MASK3 MASK5 MASK7 MIF MINS MINS2 MINUS2 MP1 MP2 MP2PT MP3 MP4 MP4PT MP5 MP5PT MULT NEG NOGO NOHERE NORF NORM 4-13 5705 5737 0052 5600 6162 5655 6617 0045 5664 6756 5653 5654 6370 5627 6622 0046 5660 5661 5662 6544 6373 6371 6400 6466 6471 6356 6467 6437 6355 6465 6357 5767 6653 6125 6137 5773 5770 NORMF OPMINS OUTGO OVER1 OVER2 PAGENO QUOL RAR1 RAR2 REST RETN2 RETURN ROOTGO SAVE SGN SHIFT SIGN SIGN1 SMACLA SNSWIT SPACLA SQCON1 SQEND SQEND1 SQROOT SQUARE TABLE TABLE6 TAG1 TAG2 TEST2 TEST3 TEST4 TEST5 THIR UNORM 6360 5741 6116 0043 0047 5663 0051 6572 6372 6366 6151 6364 6745 5657 6365 6076 6336 6654 6363 6347 6362 6761 6754 6751 6656 6163 5665 6545 6147 6150 6143 6144 6145 6146 6470 5772 IFLOATING POINT 1/0 ROUTINES IREQUIRES FLOATING POINT INTERPRETER IENTRY AT 0007 0001 5600 *7 FPNT, 5600 0044 0045 0046 0000 0000 00((J0 *44 EXPONT, HORDER, LORDER, 0 0 0 0052 0053 0054 0055 0056 0051 0060 ((J((J((J0 ((J0((J0 000((J 7111 1117 0000 0000 16161 16170 6111 6172 6173 6174 6115 6176 6111 0000 1056 7550 5767 1377 4776 5767 7344 0212 *52 FPAC1, SWI Tl , SWIT2, CHAR, DSWIT, *6767 PRCHAR, OPUT, LFED, 0 0 0 7771 7717 0 0 IIF : ((J, NO CH-LF AFTER OUTPUT IIF = 0, NO LF AFTER CR IN INPUT ICONTAINS LAST CHARACTER READ 1= 0 IF NO CONVERSION TOOK PLACE 0 TAD SWIT2 SNA CLA Jr1P 1 PRCHAR TAD LFED JMS I OPUT JMP I PRCHAR OUT 0212 4-14 IDOUBLE PRECISION DECIMAL-BINARY IINPUT AND CONVERSION *1000 11,lrlJ0 1001 1002 1003 1004 701d5 10"'6 116"'1 1"'10 7011 1012 7"13 7"'14 1015 1016 7" 17 7"'210 00"0 12i10 3045 3046 3265 3266 4342 1336 DECONV, 145~ 5217 1335 1440 5220 7240 3265 4342 721d0 h)57 1337 75"''' 5600 1340 1510 560fd 3263 11lJ45 1lJ341 1021 11rl22 7023 1024 7"25 7"'26 7027 71cl3" 7031 71lJJ2 7"'33 7k.lJ4 7kJ35 7"'36 71637 71cJ4.:J 1041 7"'42 7043 7044 7045 7046 7"'47 7050 7051 7052 71lJ53 7054 1055 7056 7057 106" 5217 2060 2266 4241 5217 0"'160 1046 3261 1"45 3262 3264 4267 4267 4303 4267 1263 3261 3262 4303 1264 5641 7061 1062 1063 712164 1065 71666 1061 001210 0000 0000 01210121 kl001c!) 0000 0000 DECON, 744;0 MULTI0, LTEMP, HTEMP, DIGIT, REMAIN, SIGN, DNUMBR, MULT2, 0 CL.A DCA HORDER DCA LORDER DCA SIGN DCA DNUMBR JMS INPUT TAD PLUS SNA JMP DECON TAD MINUS SZA JMP .+4 CLA CMA DCA SIGN JMS INPUT CLA TAD CHAR TAD MIN9 SMA JMP I DECONV TAD PLUS12 SPA JI'lP I DECONV DCA DIGIT TAD HaRDER AND MASK SZA JMP DECON ISZ DSWIT ISZ DNUMBR Jl1S MUL Tl L1 JMP DECON 0 TAD LaRDER DCA LTEMP TAD HaRDER DCA HTEMP DCA REMAIN JMS NULT2 JMS MULT2 JMS DUBLAD JMS MULT2 TAD DIGIT DCA LTEMP DCA HTEMP JMS DUBLAD TAD REMAIN JMP I MULTlI2I IINITIALIZE MANTISSA ITEST FOR SIGN IIF-, SET SWITCH lIS IT A DIGIT INa INO IYES IOVERFLOW1 IYES-IGNORE IINDEX NUMBER OF DIGITS ICONTINUE IROUTINE TO MULTIPLY IDOUBLE PRECISION wORD IBY TEN (DECIMAL) IREMAIN=REMAINDER ICALL SUBROUTINE TO IMULTIPLY BY TWO ICALL DOUBLE ADD IADD LAST DIGIT RECEIVED IEXIT WITH REMAINDER lIN AC 0 0 121 0 0 0 IDOUBLE PRECISION WORD /STORAGE FOR DIGIT 1=0 IF PLUS: =7777 IF MINUS I=NUMBER OF DIGITS IMULTIPLY LaRDER, HaRDER BY 2 0 4-15 7070 7Ii') 71 7072 7073 7074 7075 7076 7100 71f211 7102 7103 7104 7105 7106 7107 7110 7111 7112 7113 7114 7115 7116 7117 7120 7121 7122 7123 7124 7125 7126 7127 7130 7131 7132 7133 7134 7300 1046 7004 3046 1045 7004 3045 1264 7004 3264 5667 liHHI10 7300 1046 1261 3046 7004 1045 1262 3045 7004 1264 3264 5703 0000 7300 2265 5720 1046 7041 3046 1045 7040 7430 7001 3045 5720 7135 7136 7137 7140 7141 7776 7525 7506 0012 7600 7142 7143 7144 7145 7146 7147 7150 7151 7152 7153 7154 7155 7156 7157 7160 0000 7200 6031 5344 6036 3057 1057 4766 1057 7450 5343 1370 7450 5767 1371 1~11 DUBLAD, MSIGN, CLA CLL TAD LORDER RAL DCA LORDER TAD HORDER RAL DCA HORDER TAD REMAIN RAL DCA REMAIN JMP I MULT2 0 CLA CLL TAD LORDER TAD LTEMP DCA LORDER RAL TAD HORDER TAD HTEMP DCA HORDER RAL TAD REMAIN DCA REMAIN JMP I DUBLAD 0 CLA CLL ISZ SIGN JMP I MSIGN TAD LORDER CMA lAC DCA LORDER TAD HORDER CMA SZL lAC DCA HORDER JMP I MSIGN IDOUBLE PRECISION ADDITION IROUTINE TO FOR[1 12'S COMPLEMENT IF IMINUS ISIGN=0000: EXIT 253-255 MINUS, ITEST FOR SIGN PLUS, -253 -272 ITEST FOR DIGIT MIN9, 272-260 PLUSI2, 760iO MASK, ITEST FOR OV~RFLOill IINPUT A CHARACTER, IF CR, TEST IINPUT SWITCH TO SEE IF LF SHOULD IBE TYPED. IF RUBOUT, RESTART INPUT 13 INPUT, IINPUT A CHARACTER CLA KSF JMP .-1 KRB DCA CHAR TAD CHAR JMS I OUTPUT TAD CHAR SNA JMP INPUT+1 IIGNORE BLANKS TAD MRBOUT SNA JMP I RESTRT IRUBOUT-RESTART INPUT TAD MINCR 4-16 7161 7162 7163 7164 76510 7165 7166 7167 717ft) 7171 6767 7344 7401 7401 10162 SNA CLA JMS 1 PRINT TAD CHAR JMP 1 INPUT 4765 1057 5742 PRINT, OUTPUT, RESTRT, MRBOUT, MINCR, ICR - SEE IF TO BE FOLLOWED IBY l.F IEXIT ROUTINE PRCHAR OUT FLINTP+1 -0377 377-215 IFLOATING OUTPUT "E" FORMAT TSF IUSES: JMP .-1 I I TLS 720k:> 7201 72(.12 7203 7204 72~5 7206 7207 72110 7211 7212 7213 7214 7215 7216 7217 722iil 7221 7222 7223 7224 7225 7226 7227 7230 7231 7232 7233 7234 7235 7236 7237 724(.1 7241 7242 "243 7244 7245 7246 7247 72510 7251 o"tHO *72100 FLOUTP, 10 JMS FOUTCN ICONVERT MANTISSA AND OUTPUT TAD BEXP DCA EXPONT TAD CHE JMS OUT JMS 1 FEXPPT ICONVERT EXPONENT AND OUTPUT TAD SWITl IPRINT CR-LF? 1~55 SNA CLA 7650 JMP 1 FLOUTP 56i,"!) INO-EXIT TAD CARRTN IYES 1341 JMS OUT 4344 TAD LNFEED 1342 JMS OUT 4344 JMP 1 FLOUTP IEXIT 5600 ITHIS WHOLE SUBROUTINE MAY BE ALTERED TO BUFFER ITHE OUTPUT DIGITS: CHANGE JMS OUTDG TO DCA 1 110, ETC. IclltllOk:) FOUTCN, '" CLA CLL 73I.!J1cl INUMBER>07? TAD HORDER 1045 SPA CLA 7710 I NO SET LINK CLA CML 7220 TAD SPLUS IYES 1327 7430 SZL TAD SMINUS INO 1330 JMS OUT 4344 10UTPUT "0" JMS OUTDG 4352 TAD PERIOD 1331 4344 JMS OUT 10UTPUT • " 73100 CLA CLL TAD HORDER 11045 771010 SMA CLA 5242 JMP FG01 CMA 710410 INUMBER IS NEGATIVE 3733 DCA 1 SNPT INEGATE JMS 1 MSNPT 4732 CLA CMA ISUBTRACT 1 FROM BINARY EXPONENT 72410 FG01, TAD EXPONT 11044 ICOMPENSATE AT FG04 DCA EXPONT 3"'44 3324 DCA BEXP IINITIALIZE DECIMAl. EXPONENT TAD EXPONT lIS -4<EXPONENT<-1 11044 FG02, 75010 SMA JMP FG03 ITOO LARGE: MUl.TIPLY BY 1/1V 5263 TAD FOUR 1326 4217 1324 3044 1343 4344 4737 . 4-17 1252 1100 1253 5270 1254 4401 1255 3740 1256 0000 7257 7240 7260 1324 7261 3324 7262 5246 1263 4407 7264 3372 7265 0000 7266 2324 7267 5246 7270 3734 7271 4736 7272 4135 7273 7410 7274 4357 7275 2044 7276 5274 1277 7450 7300 5311 7301 4352 7302 1325 7303 3044 7304 4735 7305 4352 7306 2044 7307 5304 7310 5617 FG03, FG04, SMA Cl.A JMP FG04 JMS I FPNT FMPY I TENPT FEXT CLA CMA TAD BEXP DCA SEXP JMP FG02 JMS I FPNT FMPY C.10 FEXT ISZ BEXP JMP FG02 DCA I OPT JMS I M2PT JMS I MI0PT ITOO SMALl.-TIMES TEN ITEN lONE TENTH IMULTIPLY BY TWO IIE.SHIFT LEFT IMULTIPLY BY TEN SKP FG05A, FG06, FG06A, 7311 7312 7313 7314 7315 7316 7317 7320 7321 7322 7323 7240 1324 3324 1045 7640 5322 1046 7650 3324 7240 5302 FG07, 1324 1325 1326 7327 1330 7331 7332 7333 7334 7335 7336 7337 7340 7341 7342 7343 0000 1772 0004 0253 0002 0256 7120 7065 7063 7041 7067 7522 7504 0215 0212 0305 BEXP, MINUS7, FOUR, SPLUS, SMINU~, PERIOiJ, MSNPT, SNPT, OPT, MI0PT, M2PT, FEXPPT, TENPT, CARRTN, LNFEED, CKE, JMS DIVTWO ISZ EXPONT JMP FG05A ICOMPENSATE FOR IBINARY EXPONENT SNA 115 FIRST DIGIT A ZERO IYES, IGNORE IMULTIPl.ICATIONS YIEl.D IDECIMAL DIGITS AS HIGH IORDER REMAINDERS lIE •• 672XI0:6+.72 •• ETC JMP FG07 JMS OUTDG TAD MINUS7 DCA EXPONT JMS 1 MI0PT JMS OUTDG ISZ EXPONT JMP FG06A JMP I FOUTCN 17 DIGITS OUTPUT?? INO: CONTINUE IYES:EXIT CLA CMA TAD BEXP DCA BEXP TAD HORDER SZA Cl.A JMP .+4 TAD LORDER SNA CLA DCA BEXP CLA CMA JMP FG06+1 IIGNORE FIRST DIGIT ISUBTRACT I FROM IDECIMAL EXPONENT 115 MANTISSA ZERO? IYES: EXP:0 o ICONTAINS DECIMAl. EXPONENT INUMBER OF DIGTS OUTPUT "1172 QJ004 G53 255-253 256 MSIGN SIGN DIGIT MULTl0 MULT2 FEXC TEN 0215 0212 305 IPOINTERS 4-18 7344 7345 7346 7347 735121 7351 121121121121 612141 5345 612146 721210 5744 OUT, 121 TSF JMP .-1 TLS CLA JMP lOUT 10UTPUT ONE ASCII CHARACTER 7352 7353 7354 7355 12101210 1356 4344 5752 OUTDG, 121 TAD C260 JMS OUT JMP I OUTDG 10UTPUT ONE DIGIT 7356 0260 C260, 0260 7557 7360 7361 7362 7363 7364 7365 7366 7367 737121 7371 7572 7573 7374 121000 711121 3344 1045 712110 3045 1046 7"'1121 312146 1344 5757 7775 3146 3147 DIVTWO, III 7400 74131 7402 7403 741214 7405 741216 741217 00"'121 7240 3313 306121 4716 7200 1057 1312 7640 5220 1313 765121 5222 3721 3313 5717 74H} 7411 7412 7413 7414 7415 7416 7417 7420 7421 7422 7423 7424 7425 7426 1427 743121 7431 7432 7433 7434 7435 1313 7650 1721 712141 3314 472121 1311 312144 441217 700121 612152 9099 1051 1319 IDIVIDE BY TWO IE. IROTATE RIGHT ITEMPORARY STORAGE CLL RAR DCA OUT TAD HORDER RAR DCA HORDER TAD LORDER RAR DCA LORDER TAD OUT JMP I DIVT\tIO C.10, 7775 3146 3147 IFLOATING POINT INPuT *7413121 FLINTP, CLA CMA DCA PRSW DCA DS\tIIT JMS I DPCVPT CLA TAD CHAR TAD PER SZA CLA JMP FIGOI TAD PRSW SNA CLA JMP FIG02 DCA I DPN DCA PRSW JMP I DPCSPT ICONSTANT .10 USED IN IFlOATING OUTPuT-PROVIDES '" FIG01, FIG02, FIG03, IINITIALIZE ·PERIOD SWITCri" 17777 = NO PERIOD IPERIOD FOUND ISECOND PERIOD IYES,TERMINATE INO - SET NUMBER OF DIGITS TO 0 ISET PERIOD SWITCH TO 121 ICONVERT REST OF STRING TAD PRSW SNA CLA TAD I DPN CMA lAC DCA SEXP JMS I MSGNPT TAD C27 DCA EXPONT JMS I FPNT FNOR FPUT FPACI FEXT TAD CHAR TAD MINUSE IPERIOD READ lN PREVIOUSLY? IYES:-NUMBER OF DIGITS IN SEXP INO ITEST SIGN INORMALIZE F.P. NUMBER ISAVE NUMBER 4-19 7436 7437 744121 7441 7442 7443 7444 7445 7446 7447 7450 7451 7640 5252 4716 4720 If1:145 7510 7leW 1 1640 5277 1046 1314 3314 SZA CLA I"E" READ IN? JMP ENDFl INO JMS 1 DPCVPT IYES - CONVi:RT DECIMAL EXPONENT JMS 1 MSGNPT ITEST SIGN TAD HORDER IEXPONENT TOO LARGE?? SPA lAC SZA CLA J:1P EXCESS IYES TAD LORDER INO:DECIMAL POINT IS TAD SEXP IC(SEXP)PLACES TO RIGHT DCA SEXP IOF LAST DIGIT lEND OF FLOATING POINT INPUT ICOMPENSATE FOR DECIMAL EXPONENTS 7452 745.3 7454 7455 7456 7457 7460 7461 7462 7463 7464 7465 7466 7467 44i17 5 ic:l 52 0000 1314 7450 56kH1 7700 ENDF'I, 7470 7471 7472 7473 7474 7475 7476 7471 751d1d 7501 75.)2 75"'3 75;04 75"'5 75106 75i07 7510 7511 7512 7513 7514 7515 7516 7517 7520 7521 7522 7523 527~ 4407 3707 "1Il~0 2314 5255 560kl 4407 3304 F'I G04, 001/10 7240 1314 .3.314 5255 1.315 3044 1315 3045 561/)101 101O~4 EXCESS, TiN, 2410id 101.11010 7372 747.3 iQld27 7522 kHHH' fdfd"'''' 3777 PC.lt1, MINUSE, C27, PiR, PRSW, SEXP, C3717, Ji'lS I FPNT F'GET FPACI FEXT TAD SEXP SNA JMP I FLINTP SMA CLA JMP FlG04 JMS 1 FPNT FMPY I PC. lI/J FEXT ISZ SEXP JMP ENDF'I+3 JMP 1 FLINTP I. IS TO THE RIGHT: IMULTIPLY BY 10 0 ICONTAINS DECIMAL EXPONENT I. lI/J 3777 DPCVPT, DECONV DPCSPT, DECON MSGNPT, MSIGN DNUMBR DPN, IOUTPUT THE EXPONENT 01/)00 FEXC, 7300 I. IS TO THE LEFT: ITIMES .1000 JMS I FPNT FMPY TEN FEXT CLA CMA TAD SEXP DCA SEXP Jl~P ENDF'1+3 TAD C.3 777 DCA EXPONT TAD C.3 777 DCA HORDER Jl'lP 1 FLINTP 010 I/J 4 24i1iO 00130 C.liQ -305 01/J27 -256 0 71/J17 712O 7066 7~fd0 IRESTORE MANTISSA 0 CLA CLL 4-20 1524 7525 1526 1521 1530 1531 1532 1533 1534 1535 1536 1531 1540 1541 1542 1543 1544 1545 1546 1541 155i:) 1551 1552 1553 1554 1555 1556 1551 1560 1561 1562 1563 1564 1565 1044 1510 1061 3044 1366 1430 1361 4114 3045 1044 2045 1310 1566 1561 1510 1511 1512 1513 1514 1113 0002 1634 0144 1166 13012 1352 TAD EXPONT SPA CMA lAC CML DCA EXPONT TAD C253 SZL TAD C255 Jt1S I DGPT DCA HORDER TAD EXPONT ISZ HORDER TAD 1'1144 SMA Jt1P .-3 TAD C144 DCA EXPOtn CMA TAD HORDER SZA JMS I DGPT DCA HORDEH TAD EXPONT ISZ HORDER TAD M12 SMA JMP .-3 TAD C12 DCA LORDER CLA CMA TAD HORDER JI1S I DGPT TAD LORDER JMS I DGPT Jl1P I FEXC 15~0 5336 1311 31044 1040 1045 1440 4114 3 III 45 1044 2045 1312 150~ 5352 1313 3046 12413 li045 4114 1046 4114 5122 C253, C255, 1'1144, C144, 1'112, C12, DGPT, 0253-2611l 255-253 1634 0144 1166 0012 OUTJG 4-21 SEXP CARRTN CrlAH CHE C. 1t6 C12 C144 ~53 ~55 ~60 ~1 C3111 DEGON DECONV DGPT DIG1 T Dl VTWO DNUMSH DPCSPT DPCV?T DPN OPT DSWI T J.)UoLAD ENDFI EXCt:S~ EXPONT Ft:XC FEXP?T FllOl FG02 FG03 FG04 Fl105A FG06 FG06A FG07 FlGOI FlG02 FlG03 FlG04 FLINTP FLOUTP FOUR FOUTCN FPACI FPNT 7.324 7341 10"'57 7.343 1312 1513 7571 7566 7567 7356 1511 7515 7"'11 7kH:l12J 7574 7063 7357 7066 7517 7516 7521 7334 0060 71ft)3 7452 7471 0044 7522 7337 7242 7246 1263 7210 7274 13161 731c:l4 7311 7420 7422 7426 HORDER HTEMP INPUT LFED LNFEED LOfWEt< LTEMP ~SK MINCR MINUS (fll NUSE M1 NUS1 £111 N9 ('lRBOUT NSllNPT MSI GN lYiSNPT MULTl ~ MULT2 MildPT £1112 £11144 M2PT OPUT OUT OUTDG OUTPUT PC. 1'" PiR PERIO!) PLUS PLUS12 PRCHAR PRINT PRSW REMAIN RESTRT SEXP SIGN SfHNUS SNPT SPLUS SW1 Tl SW1T2 TEN TENPT 741~ 7400 720'" 7326 7217 0052 0007 4-22 rd045 7062 1142 6771 1342 0046 1061 1141 1111 1135 151rd 7325 7137 7170 7520 71210 7332 7041 7067 7335 7572 7570 7336 6776 7344 7352 7166 7507 7512 7331 1136 7140 6767 7165 7513 7064 7167 7514 7065 7330 7333 7327 rd055 0056 7504 7340 EXTENDED FUNCTIONS IFLOATING POINT PACKAGE GETSGN:TAD 45 CLFPNT:JMS 1 7 IFLOATING POINT EXPONENTIAL 51.122 5023 5"'24 5025 5026 5027 503(21 5031 5032 5033 5034 5035 5036 5037 511)40 5041 5042 51643 5044 5045 5046 5041 5050 51.151 5052 5053 511154 5055 51656 0(21(21(21 1045 1110 4310 3304 4401 3213 6315 0(210(21 411116 1(2145 3305 4701 4407 6320 5315 2320 6315 3315 6320 1210 6323 5265 4323 2315 1251 6323 5262 3320 1323 6323 5315 4323 3301 1216 001210 1305 1044 3044 2304 5600 4401 6315 5216 4315 00111(21 5600 5051 5060 5061 0004 2312 14(212 5000 5(2101 5002 5003 5004 5005 501116 50(211 5~10 5011 5i(J 12 5(2113 511H4 5015 511116 511117 502111 5~21 *500111 FEXP, 0 GETSGN SPA CLA JMS FNEG DCA SIGN CLFPNT FMPY LG2E FPUT X FEXT JMS 1 FIXIT GETSGN DCA FLAG2 JMS 1 FL.OAT CL.FPNT FPUT XSQR FGET X FSUB XSQR FPUT X F:1PY X FPUT XSQR FADD D FPUT TEMP FGET C FDIV TEMP FSUB X FADD A FPUT TEMP FGET B FMPY XSQR FADD TEMP FPUT TEMP FGET X FDIV TEMP FMPY TWO FADD ONE FEXT TAD FLAG2 TAD 44 DCA 44 ISZ SIGN JI~P 1 FEXP CLFPNT FPUT X FGET ONE FDIV X FEXT JMP 1 FEXP ICONSTANTS FOR FEXP A, IC(SIGN):-1 IF X<0 0004 2372 1402 4-23 5062 5063 5064 5065 5066 5067 50713 5071 5072 5ill 73 5[374 5075 5076 51377 5100 5101 5102 51d3 5104 21300 "".,013 '''''102 2000 1010100 0000 7774 2157 5157 0012 5454 0343 0"'1217 2566 5341 0001 2705 2435 0kHH 51~5 00100 5106 5107 4757 5563 5110 5111 5112 5113 5114 kH.l00 4714 7240 5710 61000 5115 5116 5117 5120 5121 5122 5123 5124 5125 5126 5127 5130 flH'00 5131 5132 5133 5134 5135 5136 5137 5140 5141 5142 5143 5144 5145 5146 5147 5150 5151 5152 5153 01000 0000 00~0 01000 O000 0000 0000 012100 00ic10 {,1000 O000 4407 5315 3315 6320 3373 13710 3320 1365 6323 5362 3320 1357 3320 1354 3315 4323 010100 5753 5226 B, C, D, LG2E, ONE, TWO, 7774 2157 5157 0012 5454 0343 0007 2566 5341 O001 2705 2435 ~H"'H 2000 0000 00132 213100 0000 SIGN, 121 fLAG2, 0 fI Xl T, fIX fLOAT, fLOA INEGATlON SUBROUTINE fNEG, 0 JMS I ACMINS CLA CMA Jl1P I fN£G ACMINS, 61000 ICALL SUBROUTINE IN IINTERPRET£R IPOINTER TO INTERPRETER ITEMPORARY STORAGE X, 0 0 0 XSQR, 0 0 '" TEMP, 0 ZER, 0 0 0 0 10 IMAIN ALGORITHM FOR ARCTANG£NT ARCALG, CLfPNT fGET X HIPY X fPUT XSQR fMPY BET2 fADD BETl fMPY XSQR fADD BETZ fPUT TEMP fGET ALF2 fMPY XSQR fADD ALfl H1PY XSQR fADD ALfZ fMPY X fDIV TEMP fEXT JMP I .+1 ARCRTN 4-24 5154 5155 5156 5157 5160 5161 5162 5163 5164 5165 5166 5167 5170 5111 5112 5113 5174 5175 0000 2437 1643 7771 3304 4434 1713 3306 5454 0000 2437 1646 000(2) 2421 2323 1715 3427 7052 5200 52(2)1 5202 5203 5204 52(2)5 5206 5201 5210 5211 5212 5213 5214 5215 5216 5217 5221 5222 5223 5224 5225 5226 5227 5230 5231 5232 5233 5234 5235 5236 5237 5240 5241 (2)(2)(2)0 1045 7710 4642 3243 4407 6644 5644 2645 0000 1045 7710 5223 44(2)7 5645 4644 6644 0(2)00 7240 3251 5625 5131 2251 5235 441/)7 6644 5246 2644 0000 2243 5600 4642 7200 5600 5242 5243 5244 5245 511(2) 000(2) 5115 5(2)76 522~ ICONSTANTS - FLOATING ARC TANGENT 0000 ALFZ, 2437 1643 1117 ALF1, 3304 4434 1113 ALF2, 3306 5454 0000 BETZ, 2431 1646 000(2) BETl , 2421 2323 BET2, 1775 3427 7052 IFLOATING POINT ARC TANGENT *5200 0 ARTN, GETSGN SPA Cl.A JMS I NEGIT DCA FLAG1 CLFPNT FPUT I Xl FGET I Xl FSUB I CONI FEXT GETSGN SPA CLA JMP GO Cl.FPNT FGET I CONI FDIV I Xl FPUT I XI FEXT Cl.A CMA DCA Fl.OG GO, IFl.AG JMP I .+1 ICAl.l. Al.GORITHM ARCALG ARCRTN, ISZ FLOG IRETURN HERE JMP EXIT Cl.FPNT FPUT I Xl FGET PlOT FSUB I Xl FEXT ISZ Fl.AGl EXIT, JMP I ARTN JMS I NEGIT CLA JMP I ARTN ICONSTANTS FOR ARCTANGENT NEGIT, FLAG1, Xl, CONI, FNEG 0 X ONE 4-25 5246 5247 5250 0001 3110 3755 0001 3110 3755 IFLOATING LOGARITHM 5251 5252 5253 5254 5255 5256 5257 5260 5261 5262 5263 5264 5265 5266 5267 52713 5271 5272 5273 5274 5275 5276 5277 53"'1.1 5,)01 5,)k12 53k:i3 5,)04 5,)10 5 5306 5307 531'" 5311 5312 5313 5') 14 5315 5316 5317 5320 5321 5')22 5323 5324 5325 5326 5327 5331.1 5331 5332 5333 5334 5335 5336 5337 5340 0000 1045 7440 5261 4407 4775 0000 5651 77H'J 4642 4407 6774 2645 0000 1045 7450 5350 7710 5341 3243 71340 1774 31.145 4777 4407 ,)776 6644 FLOG, IJk>k'l0 7001 3774 4407 5774 2645 6774 3773 1772 3774 1771 3774 1770 3774 1365 3774 1362 3774 1357 3774 1354 3774 1644 icHH'Ht'l 2243 5651 4642 720~ 5651 PlOT, OK, START, 0 GETSGN SZA JMP OK CLFPNT FDIV I ZERO FEXT JMP I FLOG SPA CLA JMS I NEGIT CLFPNT FPUT I TEM FSUB I CONI FEXT GETSGN SNA JMP ZERGO SPA CLA JMP INVERT DCA FLAGI CMA TAD ITEM DCA 45 JMS I FLOATP CLFPNT FMPY 1 LOG2 FPUT 1 Xl FEXT lAC DCA ITEM CLFPNT FGET I TEM FSUB 1 CONI FPUT 1 TEM FMPY 1 L8 FADD I L7 FMPY I TEM FADD 1 L6 FMPY 1 TEM FADD I L5 FMPY 1 TEM FADD L4 FMPY 1 TEM FADD L3 FMPY 1 TEM FADD L2 FMPY 1 TEM FADD Ll FMPY ITEM FADD 1 Xl FEXT lSZ FLAGI JMP 1 FLOG JMS 1 NEGlT CLA Jl1P 1 FLOG IINDICATE ERROR IDIVIDE BY ZERO 4-26 5.341 5.342 5.34.3 5.344 5345 5.346 5.341 5.350 5.351 5.352 5.35.3 5.354 5.355 5.356 5351 5360 5.361 5362 5363 5.364 5.365 5.366 5.367 5.3 70 5.3 71 5.372 5.3 7.3 5374 5375 5376 5377 4401 5645 4114 6114 000121 1240 5214 4401 5115 001210 5651 01210121 .3111 1142 1111 400121 4100 7777 2517 121.31217 1776 411.3 1211 5547 5552 5555 5560 512.3 5126 5544 556.3 540121 5401 541212 54".3 5404 541215 5406 5407 5410 5411 5412 541.3 5414 5415 5416 5417 542121 5421 5422 542.3 5424 5425 5426 5421 54.30 54.31 5432 54.3.3 5434 01211210 1045 774121 521" 1045 77121121 561210 4741 .3.34.3 4407 4.315 6124 12112113121 4742 4.36.3 441211 672.3 5724 272.3 .3.315 672.3 2.32121 121000 1045 1710 5241 4407 612.3 01211210 INVERT, CLFPNT FGET I CONI FDIV ITEM FPUT ITEM FEXT CLA CMA JMP START ZERGO, CLFPNT FGET I ZERO FEXT JMP I FLOG 121000 Ll, .3111 1142 1177 L2, 41210121 41121121 L.3 , 7777 2517 121.307 7776 L4, 411.3 7211 L5, LOG5 LOG6 L6, L7, LOG7 LOG8 L8, TEM, TEMP ZERO, ZER LOG2, LOGE2 FLOATP, FLOA IFLOATlNG POINT SINE *541210 FSIN, GETSGN SMA SZA CLA JMP MOD GETSGN SMA CLA JMP I FSIN JMS I NEGT MOD, DCA PNTR CLFPNT FDIV TWOPI FPUT I XSQ2 FEXT JMS 1 FlXR JMS FLOA CLFPNT FPUT I X2 FGET I XSQ2 FSUB I X2 FMPY TWOPI FPUT I X2 FSUB PI FEXT GETSGN SPA CLA JHP PCHECK CLFPNT FPUT I X2 FEXT " IX>"? IYES X=9? IYES SIN(0)=1il INO:SIN(-X):-SIN(X) IREDUCE X MODULO 2 PI INO IX<PI? IYES INa SIN(X-PI)=-SIN(X) 4-27 5435 5436 5431 5440 5441 5442 5443 5444 5445 5446 5441 5450 5451 5452 5453 5454 1343 1653 1040 3343 4401 5123 2114 1045 111B 5255 4401 5320 2123 6123 01111110 5455 5456 5451 5460 5461 5462 5463 5464 5465 5466 5461 541111 5411 5412 5413 5414 5415 5416 54'11 5500 551111 5502 4401 5123 4114 6123 3123 6124 5325 3124 1330 3124 1333 3124 1336 3124 1114 3123 1111110111 2343 5600 4141 120111 5600 PAl..G, 5503 5504 551115 5506 5501 5510 5511 5512 5513 0000 4401 6123 5114 2123 0000 1303 3200 5201 FCOS, PCHECK, """" TAD PNTR SNA Cl..A CMA DCA PNTR Cl..FPNT FGET I X2 FSUB I PI2 FEXT GETSGN SPA Cl..A JMP PAl..G Cl..FPNT FGET PI FSUB I X2 FPUT I X2 FEXT IX<PI/2? IYES INO ISIN(X):SIN(PI-X) CI..FPNT FGET I X2 FDIV I PI2 FPUT I X2 FMPY I X2 FPUT I XSQ2 FGET C9 FMPY I XSQ2 FADD C1 FMPY I XSQ2 FADD C5 FMPY I XSQ2 FADD C3 FMPY I XSQ2 FADD I PI2 FMPY I X2 FEXT ISZ PNTR JMP I FSIN JMS 1 NEGT CI..A JMP I FSIN IFl..OATlNG POINT COSINE 0 CI..FPNT FPUT I X2 FGET I P12 FSUB I X2 FEXT TAD FCOS DCA FSIN JMP FSIN+l ICOS(X):SlNCPI/2-X) ICONSTANTS AND POINTERS 5514 5515 5516 5511 552111 5521 5522 5523 5524 5246 0003 3110 3155 0002 311111 3155 5115 5120 PI2, TWOPI, PI, X2, XSQ2, PlOT 0003 3110 3155 0002 3110 3155 X XSQR IPI/2 4-28 5525 5526 5527 5530 5531 5532 5533 5534 5535 5536 5537 5540 5541 5542 5543 7764 2366 5735 7771 5466 6317 7775 2431 5053 0000 5325 0420 5110 4757 0000 ISINE CONSTANTS 7764 C9, 2366 5735 C7, 7771 5466 6317 C5, 7775 2431 5053 C3, 0000 5325 0420 NEGT, FNEG FIXR, FIX PNTR, L:1 ILOGARITHM CONSTANTS 5544 5545 5546 5547 5550 5551 5552 5553 5554 5555 5556 5557 55610 5561 5562 L:1001O 2613 4414 7776 2535 331211 7775 4746 5563 5564 5565 5566 5567 5570 5571 5572 5573 5574 0000 7300 3046 1374 3044 4407 70130 0000 5763 0013 4757 4760 4761 4762 4763 4764 4765 4766 4767 477'.1 4771 4772 4773 4774 010010 1044 7540 5365 10771 7774 2236 4304 7771 4544 1735 72100 5375 1377 3044 1044 7700 5757 4774 5367 621013 LOGE2 , LOG5, 0000 2613 4414 7776 2535 33~1 LOG6, 7775 4746 10771 LOG7, 7774 2236 43"'4 LOGS, 7771 4544 1735 I FLOAT C(45) FLOA, Id CLA CLL DCA 46 TAD C13 DCA 44 CLFPNT FNOR FEXT Jl'1P I FLOA C13, 0013 *4757 IFIX C(FAC) 13 FIX, TAD 44 SMA SZA JMP .+3 CLA JMP FIXEND TAD M13 DCA 44 LOOP, TAD 44 SMA CLA JMP I FIX JMS I .+2 JMP LOOP 6200 IDIVl IN INTERPRETER 4-29 4775 4776 4777 3045 5757 7765 FIXEND, M13, A ACI'liNS ALFZ ALFl ALF2 ARCALG AHCRTN ARTN 511157 5114 5154 5157 5162 5131 5226 5200 B 5~62 BETZ BET! BET2 C CLFPNT CON! C13 C3 C5 C7 C9 D EXIT FCOS FEXP FIX FIXEND FIXI T FIXR FLAGI FLAG2 FLOA FLOAT Fl.OAT? FLOG FNiG FSIN GET3GN GO INVERT LG2E LOGE2 DCA 45 JMP I FIX -13 LOG2 LOG5 LOG6 LOG7 LOGS LOOP Ll 12 L3 L4 L5 5165 51713 5173 5065 4407 5245 5574 5536 5533 5530 5525 50713 5235 5503 510100 4757 4775 5106 5542 5243 5105 5563 L6 L7 L8 MOD M13 NEGIT NEGT OK ONE PALG PCriECK PI PLOT PI2 PNTH SIGN STAliT T£M T£MP TWO TWOPI X XSQH XSQ2 Xl 51~7 5,)77 5251 51110 54iOtc1 1fd45 5223 5341 5073 5544 X2 ZEH ZEHGO ZERO 4-30 5376 5547 5552 5555 5560 4767 5354 5357 5362 5365 5370 5371 5372 5373 5410 4777 5242 5541 5261 5~76 5455 5441 5520 5246 5514 5543 5l1.14 5274 5374 5123 5HH 5515 5115 5120 5524 5244 5523 5126 5350 5375 IFLOATING OUTPUT PROGRAM IIF(62):S, THEN OUTPUT IN E FORMAT IELSE, C(62):NU"8ER OF DIGITS ICCAC):NUMBER OF PLACES TO RIGHT OF • IIF C(AC):~, THEN DON'T OUTPUT POINT ISIGN AND • NOT CQUNTED IN OUTPUT ICONTENTS OF 15 LOST DURING OPERATION 7201 7202 72143 72S4 4777 4217 1324 4776 7211)7 7200 7221 72314 1231 7232 3415 1000 70140 71it00 7301 3415 7305 3415 7376 7371 5412 5400 54140 5401 5402 5403 5404 5405 5406 5407 5410 5411 5412 5413 5414 5415 5416 5411 5420 5421 5422 5423 5424 5425 5426 5427 5430 5431 5432 0000 3352 1062 7041 3347 1357 3351i 1363 3ftH5 561it0 a0"" 31it44 1363 31415 1415 47'1 1062 *7201 *7207 *7227 *7301 *7305 *737' *5414~ EDIT, TGO, 76511 5327 2212 2212 1044 7510 530" 1352 7041 10'2 TRYAGN, JMS 1 7377 IALTERATIONS FLOATING OUTPUT JMS 7217 TAD 7324 JMS 1 7376 CLA DCA 1 15 NOP NOP NaP DCA 1 15 DCA 1 15 TGO EDIT 0 DCA SAC TAD '2 C"A lAC DCA COUNT1 TAD "8 DCA COUNT2 TAD SAD1 DCA 15 JMP 1 EDIT 0 DCA 44 TAD SAD1 DCA 15 TAD 1 15 J"S 1 oun TAD 62 SNA CLA JMP EFORM ISZ TGO ISZ TGO TAD 44 SPA JMP "INS TAD SAC CMA .1AC TAD '2 4-31 5433 5434 5435 5436 5431 5440 5441 5442 5443 5444 151/iJ 5266 145111 5245 1041 3351 1353 4321 2351 5241 5445 5446 5441 5450 5451 5452 5453 5454 5455 1044 1041 1450 5256 3351 4331 4321 2351 5252 G01, TAl) 44 CMA lAC SNA JMP G02 DCA CNTR JMS GET JMS OUT ISZ CNTR JMP .-3 5456 5451 5460 5461 5462 5463 5464 5465 5466 5461 5410 5411 5472 5473 1352 1650 5263 1354 4161 4331 4321 52Q3 1352 1700 5214 1356 4321 5271 G02, TAD SAC SNA CLA JMP .+3 TAD PERIOD JMS I oun JMS GET JMS OUT JMP .-2 TAD SAC SMA CLA JMP ERGO TAD CHX JMS OUT JMP .-2 5414 5475 5476 5477 12451 1352 3352 5225 ERGO, CLA CMA TAD SAC DCA SAC JMP TRYAGN 5500 5501 5502 5503 5504 55d5 5506 5511)7 5510 5511 5512 12016 1062 7041 1352 745a 5313 3351 1353 4321 2351 5307 MINS, CLA TAD 62 CMA lAC TAD SAC SNA JMP G03 DCA CNTR TAD SPCE JMS OUT ISZ CNTR JMP .-3 5513 1354 5514 4761 5515 4321 5516· 2044 5517 5315 552. 5263 5521 0000 5522 4162 G03, TAD PERIOD JMS I OUll JMS OUT ISZ 44 JMP .-2 JMp G02+5 SPA JMP ERR SNA JMP GOI CftA lAC DCA CNTR TAD SPCE JMS OUT ISZ CNTR JMP .-3 ERR, OUT, a JfoJS I OUT2 4-32 552j 5524 5525 5526 2341 5121 1355 5612 5521 55316 5531 5532 5533 5534 5535 5536 4162 1354 4161 5531 55416 5541 5542 554.3 5544 5545 5546 5541 55516 5551 5552 5553 5554 5555 555& 5551 5560 5561 5562 5563 lSZ COUNTl JMJI lOUT TAD CriE JMP 1 TGO EYORM, JMS I OUT2 TAD JlERIOD JMS I OUTl TAD M7 DCA COUNTl JMS GET JMS OUT JMP .-2 GET, It) 136~ 3347 4337 4321 5334 161616~ 235'" 5345 12414 3350 5731 1415 5737 001t)d 00160 Id"' ''' 0000 77&0 "'25& 16305 0050 1770 71"11 7344 7.552 5563 bUI'YEij Crii CtiX CNTH COUNTl COUNT2 EDIT EYORM EkGO ERR GET G01 G02 G03 MlNS M7 M8 our oun OUT2 PErUOD ;3AC SADI ~PCE IdO T..,YAGN COUNTl , COUNT2, CNTR, SAC, SPCE, PERIOD, CHE, CHX, M8, M7, OUTl , OUT2, SAD1, iUl'iER, ISZ COUNT2 JMP .+4 Cl..A CMA DCA COUNT2 JMP I GET TAD I 15 JlvtP 1 GET '00" 0 240-2'0 25& 305 330-260 -10 -7 7344 7352 iUYYER-l 5564 5555 5556 5551 5541 5550 5400 5521 5474 5466 5537 5445 545' 5513 55160 556/d 5551 5521 55" 5562 555'5552 5563 5553 5412 5425 4-33 mamaama EQUIPMENT CORPORATION MAYNA~D.MASSACHUSETTS PRINTED IN U.S.A.
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies