cdc:nos2.source:nam5871:octcon
Table of Contents
OCTCON
Table Of Contents
Source Code
- OCTCON.txt
- *DECK OCTCON
- IDENT OCTCON 000100
- EXT XTRACE 000200
- ENTRY OCTCON 000300
- *#
- *1DC OCTCON
- * 1. PROC NAME AUTHOR DATE
- * OCTCON P.C.TAM 77/08/03
- *
- * 2. FUNCTIONAL DESCRIPTION
- * THIS ROUTINE WILL CONVERT A BINARY NUMBER INTO OCTAL DISPLAYS
- * CODE FORMAT
- *
- * 3. METHOD USED.
- * GET 3 BITS AT A TIME STARTING FROM THE RIGHT, ADD 33B TO IT,
- * AND PUT IT IN THE RIGHT PLACE IN A REGISTER.
- * AFTER EXHAUSTING ALL THE BITS, WRITE THE WORD FORMED IN
- * REGISTER BACK
- *
- * 4. ENTRY PARAMETER.
- * FIRST PARAMETER REPRESENTS THE VALUE TO BE CONVERTED.
- *
- * 5. EXIT PARAMETERS.
- * SECOND PARAMETER IS STORAGE FOR THE RESULT.
- *
- * 6. COMDECKS CALLED
- * INPARU MACDEF
- *
- * 7. ROUTINES CALLED.
- * XTRACE
- *
- * 8. DAYFILE MESSAGES.
- * NONE
- *#
- *CALL MACDEF
- *CALL INPARU
- OCTCON EQ *+4S15 ENTRY / EXIT 000400
- 000500
- DEBUG1 IFEQ DEBUG,1,6
- SX6 A1
- SA6 TEMP
- SX1 XOCTCON
- RJ XTRACE
- SA1 TEMP
- SA1 X1
- ENDIF DEBUG1
- 000900
- SA2 X1 (X2) = VALUE OF PARWD 001000
- MX3 3 (X3) = 70000000000000000000B 001100
- SA1 A1+1 (X1) = ADDR. OF ARRAY TWOWD 001200
- MX6 0 WORD1 ASSEMBLED IN X6 001300
- SB1 20 (B1) = START VALUE FOR LOOP 001400
- MX7 0 WORD2 ASSEMBLED IN X7. 001500
- SB3 10 (B3) = CHAR LENGTH OF A CM WORD 001600
- SB2 1 (B2) = END VALUE FOR LOOP 001700
- 001800
- LOOP LT B1,B2,EOL 001900
- BX4 X3*X2 GET LEFT 3 BITS 002000
- LX4 3 002100
- SX4 X4+33B CONVERT TO DISPLAY CODE 002200
- GT B1,B3,WORD1 002300
- 002400
- WORD2 LX7 6 002500
- BX7 X7+X4 BUILD WORD2 002600
- JP INCR 002700
- 002800
- WORD1 LX6 6 002900
- BX6 X6+X4 BIULD WORD1 003000
- 003100
- INCR LX2 3 GET NEXT 3 BIT RIGHT 003200
- SB1 B1-1 INCREMENT LOOP COUNTER 003300
- JP LOOP 003400
- 003500
- EOL SA6 X1 STORE RESULT 003600
- SA7 X1+1 003700
- JP OCTCON 003800
- XOCTCON DATA L*OCTCN*
- TEMP BSS 1
- 003900
- END 004000
cdc/nos2.source/nam5871/octcon.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator