User Tools

Site Tools


cdc:nos2.source:nam5871:bconv

Table of Contents

BCONV

Table Of Contents

  • [00072] ENTRY POINT CALLED BY BDELINK

Source Code

BCONV.txt
  1. *DECK BCONV
  2. IDENT BCONV
  3. ENTRY BCONV
  4. EXT XTRACE
  5. SST
  6. *#
  7. *1DC BCONV
  8. * 1. PROC NAME AUTHOR DATE
  9. * BCONV J. C. LEE 76/07/28
  10. * Y. HSIEH 77/06/06
  11. *
  12. * 2. FUNCTIONAL DESCRIPTION.
  13. * THIS ROUTINE IS RESPONSIBLE FOR CHARACTER CONVERSION. IT TAKES
  14. * CHARACTER STRINGS IN 8-BIT BYTES ASCII AND CONVERTS IT TO
  15. * THE CHARACTER TYPE REQUESTED - 12-BIT BYTES ASCII OR
  16. * 6-BIT BYTES DISPLAY CODE (63 OR 64 CHARACTER TYPE).
  17. *
  18. * 3. METHOD USED.
  19. * ENTRY AND EXIT PARAMETERS ARE PASSED VIA COMMON FORDEQ
  20. * GET CHARACTER STRING FROM DATA RING
  21. * STORE PROCESSED CHARACTER STRING INTO BUFFER
  22. *
  23. * 4. ENTRY PARAMETERS.
  24. * ACT CHARACTER TYPE TO CONVERT TO 12 BIT ASCII
  25. * DRPTR FWA OF BUFFER BEFORE CONVERSION
  26. * CHARCNT NUMBER OF CHARACTERS TO CONVERT
  27. *
  28. * 5. EXIT PARAMETERS.
  29. * BUFFIN FWA OF BUFFER AFTER CONVERSION
  30. *
  31. * 6. COMDECKS CALLED.
  32. * MACDEF INPARU DEQCOM(FORDEQ)
  33. *
  34. * 7. ROUTINES CALLED.
  35. * XTRACE TRACE CALLS
  36. *
  37. * 7. DAYFILE MESSAGES. NONE
  38. *
  39. *#
  40.  
  41. **
  42. *CALL MACDEF
  43. *CALL INPARU
  44.  
  45. *CALL DEQCOM
  46.  
  47.  
  48. ** TABLE FOR CHARACTER CONVERSION
  49. * DISPLAY CODE FOR CORRESPONDING ASCII VALUE
  50. * THIS COMMON BLOCK IS ALSO USED BY ISCP AT NIP INIT. TIME
  51. * TO ADJUST THE TABLE FOR 63 OR 64 CHAR. SET
  52.  
  53. USE /COMVERT/
  54. CTABLE VFD 6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,12/0
  55. VFD 6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,12/0
  56. VFD 6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,12/0
  57. VFD 6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,6/55B,12/0
  58. VFD 6/55B,6/54D,6/52D,6/48D,6/43D,6/51D,6/55D,6/56D,12/0
  59. VFD 6/41D,6/42D,6/39D,6/37D,6/46D,6/38D,6/47D,6/40D,12/0
  60. VFD 6/27D,6/28D,6/29D,6/30D,6/31D,6/32D,6/33D,6/34D,12/0
  61. SET63A VFD 6/35D,6/36D,6/55B,6/63D,6/58D,6/44D,6/59D,6/57D,12/0
  62. VFD 6/60D,6/01D,6/02D,6/03D,6/04D,6/05D,6/06D,6/07D,12/0
  63. VFD 6/08D,6/09D,6/10D,6/11D,6/12D,6/13D,6/14D,6/15D,12/0
  64. VFD 6/16D,6/17D,6/18D,6/19D,6/20D,6/21D,6/22D,6/23D,12/0
  65. VFD 6/24D,6/25D,6/26D,6/49D,6/61D,6/50D,6/62D,6/53D,12/0
  66. SET63B VFD 6/60D,6/01D,6/02D,6/03D,6/04D,6/05D,6/06D,6/07D,12/0
  67. VFD 6/08D,6/09D,6/10D,6/11D,6/12D,6/13D,6/14D,6/15D,12/0
  68. VFD 6/16D,6/17D,6/18D,6/19D,6/20D,6/21D,6/22D,6/23D,12/0
  69. VFD 6/24D,6/25D,6/26D,6/49D,6/61D,6/50D,6/62D,6/53D,12/0
  70. USE *
  71. SPACE 5
  72. ** BCONV - ENTRY POINT CALLED BY BDELINK
  73. * TO CONVERT INBOUND DATA FROM 8-BIT ASCII
  74. * TO 12-BIT ASCII OR 6-BIT DISPLAY CODE
  75. *
  76. * REGISTER USAGE
  77. *
  78. * X0 = MASK FOR 8-BIT BYTES (52 OR 53-WITH NO PARITY BIT)
  79. * X1 = SCRATCH
  80. * X2 = INPUT WORD
  81. * X3 = SCRATCH
  82. * X4 = SCRATCH
  83. * X5 = SCRATCH
  84. * X6 = OUTPUT WORD
  85. * X7 = 0 IF 12-BIT ASCII, 54 FOR 6-BIT DISPLAY CODE BYTES
  86. *
  87. * B0 = 0
  88. * B1 = TOTAL CHARACTER COUNT
  89. * B2 = INPUT BUFFER INDEX
  90. * B3 = OUTPUT BUFFER INDEX
  91. * B4 = 64, USED TO CHECK IF HALF CHAR. EXIST AT WORD BOUND.
  92. * B5 = OUTPUT DATA SHIFT COUNT
  93. * B6 = INPUT DATA SHIFT COUNT
  94. * B7 = SCRATCH
  95.  
  96. BCONV DATA 0
  97. IFEQ DEBUG,1,6
  98. SX6 A1
  99. SA6 TEMP
  100. SX1 XBCONV
  101. RJ XTRACE
  102. SA1 TEMP
  103. SA1 X1
  104.  
  105. * INITIALIZE REGISTERS
  106.  
  107. SA1 CHARCNT LOCATION HOLD CHARACTER COUNT
  108. SB4 12 SHIFT COUNT FOR 12 BIT ASCII CHAR.
  109. SB5 48 INIT. OUTPUT DATA SHIFT COUNT
  110. SA2 DRPTR FWA OF INPUT BUFFER
  111. SB1 X1 TOTAL CHARACTER COUNT
  112. SA3 BUFFIN FWA OF OUTPUT BUFFER
  113. SB2 X2 INPUT BUFFER POINTER
  114. SB3 X3 OUTPUT BUFFER POINTER
  115. SA4 ACT OUTPUT CHAR TYPE(12-BIT ASCII/DISPLY)
  116. MX0 52 MASK FOR 8-BIT ASCII CODE
  117. SB6 8 INIT. INPUT DATA SHIFT COUNT
  118. SX7 X4-CT12ASC CHECK CHAR-TYPE IS 12-BIT ASCII
  119. MX6 0 INIT. OUTPUT WORD TO ZERO
  120. ZR X7,BCONVA SIGNAL 12-BIT ASCII CONVERSION
  121. MX0 53 MASK FOR 8 BIT ASCII WITH NO PARITY
  122. SB4 6 SHIFT COUNT FOR 6 BIT DISPLAY CHAR.
  123. MX7 54 MASK FOR 6-BIT DISPLAY CODE
  124. SB5 B4+B5 INIT. OUTPUT DATA SHIFT COUNT = 54
  125.  
  126. * READ IN NEXT WORD FROM INPUT BUFFER AND
  127. * HANDLE HALF CHARACTER CASE
  128.  
  129. BCONVA BSS 0
  130. BX3 X2 PREVIOUS INPUT WORD
  131. SB7 B6-64 CHECK FOR HALF CHARACTER CONDITION
  132. SA2 B2 READ NEXT WORD FROM INPUT BUFFER
  133. SB6 8 INIT. INPUT DATA SHIFT COUNT
  134. SB2 B2+1 INCREMENT INPUT BUFFER INDEX
  135. NZ B7,BCONVB NO HALF CHARACTER AT WORD BOUNDARY
  136. MX5 4 MASK FOR HALF CHARACTER
  137. BX1 X5*X2 SECOND HALF OF CHARACTER
  138. MX5 56 MASK FOR HALF CHAR. AT LOW BITS
  139. BX3 -X5*X3 FIRST HALF OF CHARACTER
  140. BX4 X1+X3
  141. LX4 4 CHARACTER AT RIGHTMOST POSITION
  142. SB6 4 INIT. INPUT DATA SHIFT COUNT
  143. EQ BCONVC GO PROCESS CHAR. AT WORD BOUNDARY
  144.  
  145. * CHECK END-OF-DATA. IF NOT, PROCESS NEXT CHARACTER
  146.  
  147. BCONVB BSS 0
  148. ZR B1,BCONVE ALL DONE
  149. SB7 B6-64 CHECK FOR WORD BOUNDARY
  150. PL B7,BCONVA HIT WORD BOUNDARY, GO READ NEXT WORD
  151. LX3 X2,B6 SHIFT CHAR. TO RIGHTMOST POSITION
  152. BX4 -X0*X3
  153.  
  154. BCONVC BSS 0
  155. ZR X7,BCONVD TYPE IS 12-BIT ASCII
  156.  
  157. * CONVERT 8-BIT ASCII TO 6-BIT DISPLAY CODE
  158.  
  159. BX3 -X0*X4 THE CURRENT CHARACTER
  160. AX3 3 X = CHAR. / 8
  161. BX1 X3 INDEX TO CONVERSION TABLE
  162. LX3 3 Y = X * 8
  163. IX5 X4-X3 Z = CHAR - Y (REMAINDER OF CHAR/8)
  164. IX3 X5+X5 Z * 2
  165. LX5 2 Z * 4
  166. IX4 X3+X5 Z*6 = SHIFT COUNT TO SHIFT CORRESP.
  167. SB7 X4+6 DISPLAY CODE TO RIGHTMOST POSITION
  168. SA5 X1+CTABLE INDEX TO CONVERSION TABLE
  169. LX3 X5,B7 DISPLAY CODE TO RIGHTMOST POSITION
  170. BX4 -X7*X3
  171.  
  172. * APPEND NEW CHARACTER TO OUTPUT WORD AND UPDATE POINTERS
  173.  
  174. BCONVD BSS 0
  175. LX4 X4,B5 SHIFT NEW CHAR TO PROPER POSITION
  176. BX6 X4+X6 FOR OUTPUT WORD
  177. SB1 B1-1 DECREMENT TOTAL CHAR COUNT
  178. SB5 B5-B4 OUTPUT CHAR POINTER
  179. SB6 B6+8 INPUT CHAR POINTER
  180. PL B5,BCONVB OUTPUT WORD NOT FILLED YET
  181.  
  182. * WRITE CONVERTED WORD TO OUTPUT BUFFER
  183.  
  184. BCONVE BSS 0
  185. SA6 B3
  186. MX6 0 INIT. OUTPUT WORD TO ZERO
  187. ZR B1,BCONV ALL DONE
  188. SB7 60
  189. SB5 B7-B4 INIT. OUTPUT DATA SHIFT COUNT
  190. SB3 B3+1 INCREMENT OUTPUT BUFFER INDEX
  191. EQ BCONVB CONTINUE TO CONVERT NEXT CHARACTER
  192.  
  193. XBCONV DATA L*BCONV*
  194. TEMP BSS 1
  195. END
cdc/nos2.source/nam5871/bconv.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator