User Tools

Site Tools


cdc:nos2.source:nam5871:ns_cda

NS$CDA

Table Of Contents

  • [00002] FUNC NS$CDA(CHAR)U
  • [00004] NS$CDA - CONVERT DISPLAY CODE CHARACTER TO ASCII.
  • [00008] CONVERT DISPLAY CODE CHARACTER TO ASCII.
  • [00035] PROC NS$DBG

Source Code

NS$CDA.txt
  1. *DECK NS$CDA
  2. FUNC NS$CDA(CHAR)U; # CONVERT DISPLAY CODE CHARACTER TO ASCII #
  3.  
  4. # TITLE NS$CDA - CONVERT DISPLAY CODE CHARACTER TO ASCII. #
  5.  
  6. BEGIN # NS$CDA #
  7. #
  8. ** NS$CDA - CONVERT DISPLAY CODE CHARACTER TO ASCII.
  9. *
  10. * J.C. LEE 1981
  11. *
  12. * THIS IS A UTILITY FUNCTION SUBPROGRAM. ITS FUNCTION IS TO
  13. * CONVERT DISPLAY CODE CHARACTER TO ASCII.
  14. *
  15. * FUNC NS$CDA(CHAR)
  16. *
  17. * ENTRY:
  18. * CHAR = 6-BIT DISPLAY CODE CHARACTER TO BE CONVERTED.
  19. *
  20. * EXIT:
  21. * NONE.
  22. *
  23. * METHOD:
  24. * USE DISPLAY CODE CHARACTER TO INDEX INTO THE 7-BIT
  25. * ASCII CONVERSION TABLE WHICH IS INITIALIZED FOR
  26. * CDC 64-CHARACTER SET.
  27. *
  28. #
  29.  
  30. ITEM CHAR U; # DISPLAY CODE CHARACTER #
  31.  
  32. $BEGIN
  33. XREF
  34. BEGIN
  35. PROC NS$DBG; # TRACE PROCEDURE CALL #
  36. END
  37. $END
  38.  
  39. ITEM I U; # WORD INDEX INTO CONVERSION TABLE #
  40. ITEM J U; # BIT INDEX INTO CONVERSION TABLE WORD #
  41. #
  42.   DISPLAY CODE TO 7-BIT ASCII CHARACTER CONVERSION TABLE -
  43.   INDEXABLE BY DISPLAY CODE AND INITIALIZED FOR CDC 64
  44.   CHARACTER SET.
  45. #
  46. DEF L$ASCIITAB # 8 #; # SIZE OF CONVERSION TABLE #
  47. ARRAY ASCIITAB [0:7] S(1);
  48. BEGIN
  49. ITEM ASCIIC7 U(00,00,60) =
  50. [O"35203024161105432160",
  51. O"44223124563115472360",
  52. O"50243225165125532560",
  53. O"54263323014262315500",
  54. O"32554673416253265240",
  55. O"27520512217240261340",
  56. O"21667352250537205140",
  57. O"23576743720134571660"];
  58. END
  59. CONTROL EJECT;
  60.  
  61. $BEGIN
  62. NS$DBG("CDA");
  63. $END
  64.  
  65. I = CHAR / L$ASCIITAB; # WORD INDEX INTO ASCIITAB #
  66. J = (CHAR - I*L$ASCIITAB) * 7; # BIT INDEX INTO ASCIITAB WORD #
  67. NS$CDA = B<J,7>ASCIIC7[I]; # RETURN ASCII CHARACTER #
  68.  
  69. RETURN;
  70. END # NS$CDA #
  71. TERM
cdc/nos2.source/nam5871/ns_cda.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator