Digital PDFs
Documents
Guest
Register
Log In
DIGITAL-8-29-U
December 1966
10 pages
Original
0.4MB
view
download
Document:
digital-8-29-u-d
Order Number:
DIGITAL-8-29-U
Revision:
Pages:
10
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/digital-8-29-u/digital-8-29-u-d.pdf
OCR Text
IDENTIFICATION Digital-8-29-U-Sym I .2 Double Precision Decimal-fo-Binory Conversion and Input (ASR-33) I .3 (Signed or Unsigned) Jonuory I4, I966 PUP—8 LIBRARY Digital-8—29-U—Sym Page l 2 ABSTRACT . This routine accepts a string of up to eight decimal digits (double-precision for the PDP-8) from the Teletype keyboard and converts it to the corresponding twos complement binary number. The string may contain as legal characters a sign (+, —, or space) and the digits 0-9. If the first legal character is not a sign, the conversion is unsigned. A ”back—arrow" (‘— ) at any point in the string erases the current string and allows the operator to re—enter the value. Any character after the first, other than another digit or ”back-arrow", causes the conversion to terminate and is found in location "DIDSAV" within the subroutine. 3. REQUIREMENTS 3 l Storage . This subroutine requires llO core locations. 3.2 Subprograms and/or Subroutines (None) 3.3 Equipment Basic PDP-8 with ASR-33 4. USAGE 4 l Loading . The symbolic tape provided may be assembled with the user's main program with either PAL II}r or MACRO-8. There is neither origin setting nor terminating "$" on the symbolic tape, but a PAUSE pseudo-instruction is the last line on the tape. 4.2 Calling Sequence The subroutine is called by an effective JMS to location DDCB. The location immediately following the JMS instruction contains the address of the location where the high-order portion of the number is stored. (It is assumed that the low-order portion of the number is in the location immediately following the high-order portion.) Return is to the second location down from the calling JMS with the AC clear. 4.3 Switch Settings (Not Applicable) 4.4 Start-up and/or Entry (Not Applicable) 4.5 Errors in Usage If the string of decimal digits is preceded by a sign (+, —, or space), the maximum decimal number that is correctly accepted is 8388607 (223-4) The sign, if any, must appear first. If the string of decimal is not preceded by a sign, the maximum decimal number that is correctly accepted is . digits -1). 16777215 (22 4.6 Recovery from such Errors If neither of these maxima is exceeded, the results are unspecified. Digital-8-29-U-Sym Page 2 5 RESTRICTIONS (None) . 5 .1 Status Active Registers The status of AC and link is not preserved. 5 .2 .. 5.3 Status Core (Not Applicable) Status Hardware This subroutine should not be used with the interrupt on. 5 .4 Miscellaneous The magnitude restrictions on numbers is described in 4.5 6. DESCRIPTION 6 .1 Discussion on . The discussion, example and scaling of the conversion is given in 6.l and 6.3 of the write-up Digital-8-28-U. The only difference is that the multiplications by "4" and "2" are performed by the arithmetic shifts as described in Digital-8-8—U. METHOD 7. See Digital-8-l2-U 8 FORMAT . 8.l a . sign, 0-9, 8 .2 Input Data The input string may or may not contain a sign (+, —, or space). Any character other than rubout causes the subroutine to terminate as does a sign in any but the first position. or Core Data The high-order portion of the binary equivalent of the number is found in the location specified by the address following the JMS. The low-order portion is found in the next successive location. This is the format compatible with the double-precision, fixed point arithmetic subroutines. The terminating character is found in location DIDSAV. 8 .3 Output Data Spacing tabulation, carriage return, etc. are not provided for in this subroutine. Digital-8-l9—U-Sym which contains short subroutines for the latter purposes. , 9. EXECUTION TIME 9.l Minimum (Not Applicable) 9.2 Maximum (Not Applicable) See Digital-8-29—U-Sym Page 3 9.3 Average This subroutine is input limited at a maximum of 10 cps. 10. PROGRAM 10.1 Core Map (None) 10.2 Dimension List(s) (None) 10.3 Macro, Parameter, and Variable Lists (None) 10.4 Program Listing /DOUBLE /CALLING PRECISION DECIMAL-TO-BINARY DICONV / JMS / ADDRES DICONV) IGNORED /SUBROUTINE /ADRESS 2332 @291 7333 CLA CLL @202 1324 TAD DISET1+1 /INITIALIZE @223 3235 DCA DICTRL @204 1324 TAD DISET1+1 OZOS 3227 1602 DCA TAD DIXSWI 8226‘ @297 3351 DCA DIGET 0210 3352 DCA DIHIHD /CLEAR @211 3353 DCA DILOHD /NUMBER 0212 3347 DCA DINEGI @213 5275 JMP DIIN @214 3352 DCA DIDSAV @215 1353 TAD DIDSAV @216 1341 TAD DIRBUT @217 7452 SNA @220 5201 JMP DICONV+1 DIM26O I DICONV U221 1342 TAD 7512 SPA @223 5235 JMP @224 1343 TAD DIM27I /STORE CHARACTER IT /YES, IT SMA SZA DICTRL /YES, @227 7333 CLA CLL /NO, /CLOSE 1234 TAD .+4 DCA 0'2 @232 1252 TAD DINMBR-l @233 3235 DCA DICTRL JMP DINMBR @234 5251 @235 7223 @236 1352 TAD DIDSAV @237 1344 TAD DIMSPC @240 7452 SNA @241 5324 JMP DISET1+1 @242 1345 TAD DIMPLS CLA @243 7450 SNA QQ44 5324 JMP /IS IT LESS GREATER SWITCH /IS DISET1+1 IT /YES; IT /YES, 26% TO HOL- TO THAN TO TO TO 271 TO A "SPACE"? SET SWITCH A "PLUS"? SET SWITCH CI (IE.9 WHAT WAS A CI D. "DINMI TERMINAI SENSE CHECKING "O7 WHAT SEE GO ERI (IE. SEE CHARACTER SWITCH /CONTINUE /IS THAN TRANSFER FIRST /SET HI. A "BACK-ARROW"(IE. REINITIALIZE TRANSFER /YES, JMP 3227 STORE SWITCH 7743 @231 TO ADDRESS NEGATIVE 5235 @230 SWITCHES /CLEAR @226 CLA PROGRAM USED @225 DICTRL: 3 ADDRESS+1 IN LOCATIONS /IS DICTRL UP /PICK /IS @222 DIXSWI: HIGH-ORDER WORD ‘O 922% DIPROC: CALLED STORE TO ~ORDER /LOW / INPUT AND CONVERSION /AC SEQUENCE: TO DETERMI TO SENSE TEE TO SENSE TEI Digital-8-29-U-Sym Page 4 0245 1346 TAD 0246‘ 7650 SNA CLA /IS A "MINUS”? @247 5323 JMP DISETI /YES;SET NEGATIVE 025W JMP DIEND /NO, IT WAS A TERMINATING CH. /STORE ASSEMBLED NUMBER TEMP. D253 5332 1353 3354 1352 @254 3355 @255 433% JMS DIDSPL 0256 4330 DIDSPL @251 @252 DINNER: DIMMNS TAD DILOHD DCA DIXTMl TAD DIHIHD DCA DIXTM2 D257 1353 JMS TAD @263 1354 TAD DIXTMI @264 3353 DCA DILOHD @262 7994 RAL IT IMULTIPLY AND. SWITCH CURRENT BY "ID" DILOHD 0263 1352 TAD DIHIHD 0264 TAD DIXTM2 @265 1355 3352 DCA DIHIHD 0266 4339 DIDSPL @267 1350 JMS TAD @270 @271 @272 @273 0274 @343 AND DIXMSK /PICK /MASK /ADD CURRENT DIGIT HIGH-ORDER BITS REMAINDER TO CURRENT /DID IT DIDSAV 1353 TAD DILOHD 3353 DCA DILOHD 743% SZL 2352 ISZ /INPUT OVERFLOW? CORRECT HIGH-ORDER 6031 5275 JMP @277 0300 6036 KRB 6046 TLS 0391 5214 JMP DIPROC ITERMINATING ROUTINE @392 7200 DIEND: @393 TAD DINEGl /PICK CLL RAR /PUT @305 1347 7110 1352 TAD DIHIHD /PICK @303 7430 SZL /IS @307 CMA /YES: 0311 7040 3751 1353 @312 7430 @313 DIIN: 0‘1 CLA LINK "1"? CLL CMA 0316 7141 7430 2751 7000 D317 2351 ISZ @323 3751 DCA I 0321 2200 ISZ DICONV @322 5600 JMP I 0323 2347 ISZ 'DINEGl /SET @324 7300 CLA CLL ICLOSE 0325 1250 TAD DINMBR-l @326 3235 DCA DICTRL @327 5275 JMP DIIN ISZ @093 @331 1353 7164 3353 0332 @333 /15 I DISETl: DIGET DIDSPL: DIGET DIGET O TAD DILOHD CLL RAL DCA DILOHD COMPL. PORTION "1"? TWO'S LINK COMPolT. OVER. IF "1"? PRTION /INDEX HIGH-ORDER /TAKES CARE /INDEX POINTER FOR ISTORE LOW-ORDER WHEN HIGH-ORDER . LOW-ORDER. POTION OF N. CORRECT RETURN /RETURN /JUMP LEFT LOW-ORDER /INDEX FOR DICONV PRECISION LINK /YES; NOP /DOUBLE D333 IAC SZL N. PORTION IT UP /PICK IF ("1" ORDER NEGATIVE. NUMBER DILOHD NUMBER LINK. HIGH TAD SZL /IS INTO UP /STORE DIGET NEGATIVE UP IT I 0315 WORD KSF DCA 0314 NUB ROUTINE @276 0310 OFF /YES; DIHIHD @275 @304 UP SHIFT (X2) NEGATIVE SWITCH TO WAIT SWITCH TO FOR TRANSFER TO. NEXT CHARAI Digital-8—"29-U-Sym Page 5 @334 1352 TAD @335 7@@4 RAL @336 3352 DCA DIHIHD @337 573@ JMP I /CON5TANTS AND DIHIHD DIDSPL VARIABLES @34@ 9917 DIKMSK: 17 /MASK FOR LAST @341 7441 DIRBUT: -337 /CODE FOR ERASE @342 9957 DIM26Q: 57 /NUMBER USED TO GENERATE CODI @343 7767 DIM271: -ll /NUMBER USED TO GENERATE COD! @344 75413 DIMSPC’ -24@ ICODE @345 7765 DIMPLS: -13 FOR SPACE /NUMBER USED TO GENERATE @346 DIMMNS: “2 /NUMBER TO GENERATE CODI CODI @347 7776 9999 @35@ 9999 DIDSAV) @351 9999 DIGET: @352 9999 DIHIHD: @353 9999 DILOHD: @354 9999 DIXTMI: @355 9999 DINEGI: DIXTMZ: PAUSE DICONV @2@@ DICTRL DIDSAV i DIDSPL @235 DIEND @3@2 DIGET @351 @35@ @33@ DIHIHD @352 DIIN @275 DILOHD @353 DIMMNS @346 DIMPLS @345 DIMSPC @344 DIM26@ @342 DIM271 @343 DINEGI @347 DINMBR @251 DIPROC @214 DIRBUT @341 DISETI @323 DIXMSK @34@ DIASNI @227 DIXTMI @354 DIXTMZ @355 /STORAGE GGGG USED FOUR LOCATIONS BITS DIgi’roI-8—29- U-Sym Page 6 II. DIAGRAMS 1].] Flow Chart I I ENTRY I INITIALIZE PROGRAM SWITCHES AND ZERO LOCATIONS FOR HOLDING FIRST CHARACTER IS A TERMINATING CHARACTER PARTIALLY-ASSEMBLED. DOUBLE-PRECISION N0. I PICK UP ADDRESS FROM CALLING SEQUENCE FOR STORING DOUBLE PRECISION NUMBER '- S EGATIVE SWITCH SET 7 COMPLEMENT THE DOUBLE-PRECISION ERROR MADE OPERATOR WISHES TO ERASE NUMBER WAIT FOR CHARACTER FROM KEYBOARD 0R READER NUMBER *1 I THIS IS A TERMINATING STORE RESULT IN " ADDRESS SPECIFIED BY THE CALLING SEQUENCE CHARACTER FIRST CHARACTER wAS A DECIMAL DIGIT SAVE INCOMING CHARACTERIN DI SET SWITCH J'I DSAu" I SET YES CONTROL SWITCH BACK— ARROW T PICK UP PARTIALLY- NO ASSEMBLED. DOUBLEPRECISION NUMBER YES IS CONTROL SWITC I LESS THAN 260 S T ? MULTIPLY BY FOUR (IE DOUBLE SHIFT LEFT TWICE) NO I PICK UP INCOMING ADD THE PARTIALLY CHARACTER GREATER THAN 27| 7 — ASSEMBLED. DOUBLE— PRECISION NUMBER I NO MULTIPLY BY TWO (IE DOUBLE SHIFT LEFT ONCEI IS SWITCH #I SET ? N0 I ADD THE INCOMING YES DECIMAL DIGIT TO THE RESULT [SET NEGATIVE SWITCH I SET I CONTROL STORE SUM AS THE NEW SWITCH PARTIALLY-ASSEMBLED. I DOUBLE-PRECISION J v NO. Digital-8—29-U-Sym Page 7 REFERENCES 12.] Other Library Programs Digital-8—8-U-Sym DigifoI-8-19-U-Sym Digital-8-28-U-Sym
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies