Table of Contents

KEYUTIL

Table Of Contents

  • [00003] KEYUTIL - KEY UTILITY HOST LOADED CONTROLWARE.
  • [00007] KEY UTILITY HOST LOADED CONTROLWARE.

Source Code

KEYUTIL.txt
  1. IDENT KEYUTIL
  2. MACHINE Z80
  3. TITLE KEYUTIL - KEY UTILITY HOST LOADED CONTROLWARE.
  4. *COMMENT KEYUTIL - KEY UTILITY HOST LOADED CONTROLWARE.
  5. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  6. KYU SPACE 4,10
  7. *** KEYUTIL - KEY UTILITY HOST LOADED CONTROLWARE.
  8. *
  9. * W. F. ANSLEY. 83/06/01.
  10. * M. L. SWANSON. 85/01/03.
  11. KYU SPACE 4,10
  12. *** *KEYUTIL* IS THE SOURCE CODE FOR THE Z80 PROGRAM THAT
  13. * IS LOADED INTO THE 721 TERMINAL BY THE *KEY* UTILITY.
  14. * THE PROGRAM *KEYEX* ACTUALLY HAS THE BINARY FOR THIS
  15. * PROGRAM HARDCODED WITHIN ITSELF; THIS PROGRAM IS INCLUDED
  16. * ON THE OPL FOR DOCUMENTATION PURPOSES ONLY. IF ANY
  17. * CHANGES ARE MADE TO THIS PROGRAM, CORRESPONDING CHANGES
  18. * MUST BE MADE TO THE HARDCODED VALUES WITHIN *KEYEX*.
  19. KYU SPACE 4,10
  20. *** ASSEMBLY CONSTANTS.
  21.  
  22. SENDB EQU #0087 SEND CHARACTER IN B
  23. OBYTE2 EQU #E047
  24. DLMENA EQU #E0B9
  25. KYT EQU #D7E0 KEY TABLE ADDRESS
  26. KTL EQU #F0 KEY TABLE LENGTH
  27. DEFB EQU #C000 DEFINITION BUFFER
  28. DFBE EQU #CAFF DEFINITION BUFFER END
  29.  
  30. ORG #D100
  31.  
  32. KYU SPACE 4,25
  33. *** PUSH - PUSH FUNCTION KEY DEFINITIONS.
  34. *
  35. * *PUSH* COPIES THE IMAGE OF THE CURRENT KEY DEFINITIONS
  36. * AND COPIES IT TO A BUFFER WITHIN THE TERMINAL.
  37. *
  38. * CALLS RESET.
  39.  
  40. PUSH BSS 0 PUSH ROUTINE
  41. LD DE,SKTB GET KEY TABLE ADDRESS
  42. LD BC,KTL GET BYTE COUNTER
  43. LD HL,KYT GET KEY TABLE SAVE AREA
  44. LDIR PUSH KEY TABLE
  45. LD A,(OBYTE2)
  46. LD (OBS2),A SAVE SETUP CHARACTERISTICS
  47. LD A,(DLMENA)
  48. LD (DLMS),A SAVE DELIMITER FLAG
  49. SCF CARRIAGE RETURN AFTER FUNCTION KEY
  50. CCF CLEAR CARRY FLAG
  51. LD A,(DEFB) GET LENGTH OF KEY DEFINITIONS
  52. LD D,A
  53. LD A,(DEFB+1)
  54. LD E,A
  55. INC DE
  56. INC DE SET DE TO LENGTH+2
  57. LD (DFLS),DE SAVE TOTAL LENGTH
  58. LD HL,DFBE MOVE HL TO END OF DEF BUFF
  59. SBC HL,DE SET HL TO START OF PUSH AREA
  60. LD (DFSA),HL SAVE WHERE MOVED
  61. EX DE,HL MOVE DE TO LOCATION MOVED
  62. LD HL,DEFB SET HL TO KEY DEFINITION BUFFER
  63. LD BC,(DFLS) SET NUMBER OF BYTES TO MOVE
  64. LDIR PUSH DEFINITIONS
  65. CALL RESET RESET DEFINITION TABLE
  66. RET RETURN
  67.  
  68. KYU SPACE 4,25
  69. *** POP - POP FUNCTION KEY DEFINITIONS.
  70. *
  71. * *POP* COPIES THE STORED FUNCTION KEY DEFINITIONS
  72. * FROM THE BUFFER WITHIN THE TERMINAL TO THE
  73. * RESIDENT FUNCTION KEY DEFINITION AREA.
  74.  
  75. POP BSS 0 ENTRY
  76. LD HL,SKTB RESTORE KEY TABLE BUFFER ADDRESS
  77. LD BC,KTL RESTORE KEY TABLE LENGTH
  78. LD DE,KYT RESTORE KEY TABLE AREA
  79. LDIR RETURN USERS DEFINITIONS
  80. LD A,(OBS2)
  81. LD (OBYTE2),A RESTORE OBYTE2
  82. LD A,(DLMS)
  83. LD (DLMENA),A RESTORE DELIMITER FLAG
  84. LD HL,(DFSA) DEF SAVED ADDRESS
  85. LD A,H
  86. OR L
  87. RET Z IF NONE
  88.  
  89. LD DE,DEFB RESTORE DEFINITION BUFFER
  90. LD BC,(DFLS) NUMBER OF BYTES TO MOVE
  91. LDIR RESTORE DEFINITIONS
  92. RET RETURN
  93.  
  94. KYU SPACE 4,25
  95. *** RESET - RESET DEFINITION TABLE.
  96. *
  97. * *RESET* INITIALIZES THE RESIDENT KEY DEFINITION TABLE
  98. * WITHIN THE TERMINAL.
  99.  
  100. RESET BSS 0 ENTRY
  101. LD A,(OBYTE2) GET OBYTE2
  102. OR 2 SET NUMERIC PAD SHIFTED
  103. LD (OBYTE2),A REPLACE OBYTE2
  104. LD A,0
  105. LD (DLMENA),A SET DELIMITER FLAG FALSE
  106. LD BC,KTL+3
  107. RESET1 BSS 0
  108. DEC BC
  109. DEC BC
  110. DEC BC
  111. LD A,B
  112. OR C
  113. RET Z UNTIL DONE WITH TABLE
  114.  
  115. LD HL,KYT-3 SET HL TO KEY TABLE-3
  116. ADD HL,BC SET HL TO DEFINITION BYTE
  117. LD (HL),#30 UNDEFINE KEY
  118. JR RESET1
  119.  
  120. KYU SPACE 4,25
  121. *** LABEL - GET LABELS FROM MEMORY.
  122. *
  123. * *LABEL* RETRIEVES THE STORED FUNCTION KEY LABELS
  124. * FROM WITHIN THE TERMINAL MEMORY.
  125. *
  126. * CALLS POP, PUSH, SENDB.
  127.  
  128. LABEL BSS 0 ENTRY
  129. LD A,(#D8DD)
  130. LD H,A
  131. LD A,(#D8DE)
  132. LD L,A
  133. LABEL1 BSS 0
  134. LD B,(HL)
  135. LD A,B
  136. CP #FF
  137. JP Z,LABEL2 UNTIL REACH LAST BYTE
  138.  
  139. PUSH HL
  140. CALL SENDB SEND CHARACTER TO HOST
  141. POP HL
  142. INC HL TO NEXT CHARACTER
  143. JR LABEL1
  144. LABEL2 BSS 0
  145. LD B,#0D
  146. CALL SENDB SEND CARRIAGE RETURN
  147. RET RETURN
  148.  
  149. DFSA BSS 2 DEFINITIONS SAVED ADDRESS
  150. SKTB BSS KTL SAVE KEY TABLE BUFFER
  151. OBS2 CON 0 OBYTE2 SAVE AREA
  152. DLMS CON 0 DELMENA SAVE AREA
  153. DFLS CON 0 DEF LENGTH SAVE AREA
  154.  
  155. END