User Tools

Site Tools


cdc:nos2.source:nam5871:dlconvt

DLCONVT

Table Of Contents

Source Code

DLCONVT.txt
  1. *DECK DLCONVT
  2. IDENT DLCONVT
  3. ENTRY DLCONVT
  4. *IF DEF,IMS
  5. *#
  6. *1DC DLCONVT
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * DLCONVT P.C.TAM 78/09/27
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION.
  12. * CONVERT NUMERIC DISPLAY CODE FIELD TO BINARY
  13. *
  14. * 3. METHOD USED.
  15. * SELECT EACH DIGIT, CHECK IF NUMERIC, CONVERT TO BINARY
  16. *
  17. * 4. ENTRY PARAMETERS.
  18. * (A1) ADDRESS OF THE ADDRESS OF DISPLAY WORD
  19. * (A1)+1 ADDRESS OF THE ADDRESS OF RESULT
  20. * (A1)+2 ADDRESS OF THE ADDRESS OF THE COMPLETE FLAG
  21. *
  22. * 5. EXIT PARAMETERS.
  23. * SAME AS 4.
  24. *
  25. * 6. COMMON DECKS CALLED.
  26. * MACDEF CYBERDEFS
  27. *
  28. * 7. ROUTINES CALLED.
  29. * NONE.
  30. *
  31. * 8. DAYFILE MESSAGES.
  32. * NONE.
  33. *#
  34. *ENDIF
  35.  
  36. *CALL MACDEF
  37. *CALL CYBERDEFS
  38.  
  39. DLCONVT SUBR = ENTRY/EXIT
  40. MX0 -CL
  41. SA2 X1 (X2)=WORD TO BE CONVERTED
  42. SB1 1
  43. SB2 NC
  44. MX7 0
  45.  
  46. * LOOP TO CONVERT EACH DIGIT
  47.  
  48. CONV1 BSS 0
  49. LX2 CL MASK OUT DIGIT
  50. BX3 -X0*X2
  51. ZR X3,CONEN
  52. SX5 X3-33B TEST NUMERIC
  53. MI X5,CONER
  54. SX6 X3-44B-1
  55. PL X6,CONER
  56.  
  57. BX6 X7 (X7)=(X7)*10
  58. LX7 3
  59. IX6 X6+X6
  60. IX7 X7+X6
  61. IX7 X5+X7 ADD IN CURRENT DIGIT
  62.  
  63. SB2 B2-B1
  64. NZ B2,CONV1
  65.  
  66. * END OF LOOP
  67.  
  68. CONEN BSS 0
  69. SA4 A1+B1 WRITE BINARY RESULT BACK
  70. SX6 B1 WRITE CONVERT OK FLAG
  71. SA7 X4
  72. EQ CONV2
  73.  
  74. * ERROR PROCESSING
  75.  
  76. CONER BSS 0
  77. MX6 0
  78.  
  79. CONV2 BSS 0
  80. SA4 A1+2
  81. SA6 X4
  82. EQ DLCONVTX RETURN
  83.  
  84. END
cdc/nos2.source/nam5871/dlconvt.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator