User Tools

Site Tools


cdc:nos2.source:nam5871:octcon

OCTCON

Table Of Contents

Source Code

OCTCON.txt
  1. *DECK OCTCON
  2. IDENT OCTCON 000100
  3. EXT XTRACE 000200
  4. ENTRY OCTCON 000300
  5. *#
  6. *1DC OCTCON
  7. * 1. PROC NAME AUTHOR DATE
  8. * OCTCON P.C.TAM 77/08/03
  9. *
  10. * 2. FUNCTIONAL DESCRIPTION
  11. * THIS ROUTINE WILL CONVERT A BINARY NUMBER INTO OCTAL DISPLAYS
  12. * CODE FORMAT
  13. *
  14. * 3. METHOD USED.
  15. * GET 3 BITS AT A TIME STARTING FROM THE RIGHT, ADD 33B TO IT,
  16. * AND PUT IT IN THE RIGHT PLACE IN A REGISTER.
  17. * AFTER EXHAUSTING ALL THE BITS, WRITE THE WORD FORMED IN
  18. * REGISTER BACK
  19. *
  20. * 4. ENTRY PARAMETER.
  21. * FIRST PARAMETER REPRESENTS THE VALUE TO BE CONVERTED.
  22. *
  23. * 5. EXIT PARAMETERS.
  24. * SECOND PARAMETER IS STORAGE FOR THE RESULT.
  25. *
  26. * 6. COMDECKS CALLED
  27. * INPARU MACDEF
  28. *
  29. * 7. ROUTINES CALLED.
  30. * XTRACE
  31. *
  32. * 8. DAYFILE MESSAGES.
  33. * NONE
  34. *#
  35. *CALL MACDEF
  36. *CALL INPARU
  37. OCTCON EQ *+4S15 ENTRY / EXIT 000400
  38. 000500
  39. DEBUG1 IFEQ DEBUG,1,6
  40. SX6 A1
  41. SA6 TEMP
  42. SX1 XOCTCON
  43. RJ XTRACE
  44. SA1 TEMP
  45. SA1 X1
  46. ENDIF DEBUG1
  47. 000900
  48. SA2 X1 (X2) = VALUE OF PARWD 001000
  49. MX3 3 (X3) = 70000000000000000000B 001100
  50. SA1 A1+1 (X1) = ADDR. OF ARRAY TWOWD 001200
  51. MX6 0 WORD1 ASSEMBLED IN X6 001300
  52. SB1 20 (B1) = START VALUE FOR LOOP 001400
  53. MX7 0 WORD2 ASSEMBLED IN X7. 001500
  54. SB3 10 (B3) = CHAR LENGTH OF A CM WORD 001600
  55. SB2 1 (B2) = END VALUE FOR LOOP 001700
  56. 001800
  57. LOOP LT B1,B2,EOL 001900
  58. BX4 X3*X2 GET LEFT 3 BITS 002000
  59. LX4 3 002100
  60. SX4 X4+33B CONVERT TO DISPLAY CODE 002200
  61. GT B1,B3,WORD1 002300
  62. 002400
  63. WORD2 LX7 6 002500
  64. BX7 X7+X4 BUILD WORD2 002600
  65. JP INCR 002700
  66. 002800
  67. WORD1 LX6 6 002900
  68. BX6 X6+X4 BIULD WORD1 003000
  69. 003100
  70. INCR LX2 3 GET NEXT 3 BIT RIGHT 003200
  71. SB1 B1-1 INCREMENT LOOP COUNTER 003300
  72. JP LOOP 003400
  73. 003500
  74. EOL SA6 X1 STORE RESULT 003600
  75. SA7 X1+1 003700
  76. JP OCTCON 003800
  77. XOCTCON DATA L*OCTCN*
  78. TEMP BSS 1
  79. 003900
  80. END 004000
cdc/nos2.source/nam5871/octcon.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator