home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / sigmv050.ark / GBC < prev    next >
Encoding:
Text File  |  1984-04-29  |  3.9 KB  |  210 lines

  1. ;    CompuPro Interfacer board equates.
  2.  
  3. GBP0:    EQU    0        ;Serial port zero
  4. GBP1:    EQU    2        ;Serial port one
  5. GBDATA:    EQU    0        ;Data on even I/O unit
  6. GBSTAT:    EQU    1        ;Status on odd I/O unit
  7.  
  8. GBTBMT:    EQU    00000001b    ;Transmit buffer empty
  9. GBDAV:    EQU    00000010b    ;Data available
  10. GBOPT:    EQU    00000100b    ;Optional status line
  11. GBPE:    EQU    00001000b    ;Parity error
  12. GBOR:    EQU    00010000b    ;Overrun error
  13. GBFE:    EQU    00100000b    ;Framing error
  14. GBCC:    EQU    01000000b    ;RS 232 CC input
  15. GBCB:    EQU    10000000b    ;RS 232 CB input
  16.  
  17. GBRIE:    EQU    00000001b    ;Receiver interrupt enable
  18. GBTIE:    EQU    00000010b    ;Transmitter interrupt enable
  19. GBCD:    EQU    00000100b    ;RS 232 CD output
  20. GBCA:    EQU    00001000b    ;RS 232 CA output
  21. GBTSB:    EQU    00010000b    ;Number of stop bits
  22. GBNP:    EQU    00100000b    ;No parity
  23. GBEPS:    EQU    01000000b    ;Even parity
  24. GBNBI:    EQU    10000000b    ;number of bits/character
  25. ;    C O N S O L   S T A T U S
  26. ;
  27. ;    This routine samples the Console status and returns the
  28. ;    following values in the A register.
  29. ;
  30. ;    EXIT    A = 0 (zero), means no character
  31. ;        currently ready to read.
  32. ;
  33. ;        A = FFh (255), means character
  34. ;        currently ready to read.
  35.  
  36. CONST:    IN    GBP0+GBSTAT    ;Input from port
  37.     ANI    GBDAV        ;Mask data available
  38.     RZ            ;If data not available
  39.     ORI    0FFh
  40.     RET
  41. ;
  42. ;
  43. ;
  44. ;
  45. ;    C O N S O L   I N P U T
  46. ;
  47. ;    Read the next character into the A register, clearing
  48. ;    the high order bit.  If no character currently ready to
  49. ;    read then wait for a character to arrive before returning.
  50. ;
  51. ;    EXIT    A = character read from terminal.
  52.  
  53. CONIN:    IN    GBP0+GBSTAT
  54.     ANI    GBDAV
  55.     JZ    CONIN        ;If data not available
  56.     IN    GBP0+GBDATA
  57.     ANI    7Fh
  58.     RET
  59. ;
  60. ;
  61. ;
  62. ;
  63. ;    C O N S O L   O U T P U T
  64. ;
  65. ;    Send a character to the console.  If the console
  66. ;    is not ready to receive a character wait until
  67. ;    the console is ready.
  68. ;
  69. ;    ENTRY    C = ASCII character to output to console.
  70.  
  71. CONOUT:    IN    GBP0+GBSTAT
  72.     ANI    GBTBMT
  73.     JZ    CONOUT        ;If transmit buffer not empty
  74.     MOV    A,C
  75.     OUT    GBP0+GBDATA
  76.     RET
  77. ;
  78. ;
  79. ;
  80. ;
  81. ;    P u n c h   O u t p u t.
  82. ;
  83. ;    Send a character to the punch device.  If no punch
  84. ;    device exists then immediately return.
  85. ;
  86. ;    ENTRY    C = ASCII character to output.
  87.  
  88. PUNCH:    IN    GBP1+GBSTAT
  89.     ANI    GBTBMT
  90.     JZ    PUNCH        ;If transmit buffer full
  91.     MOV    A,C
  92.     OUT    GBP1+GBDATA
  93.     RET
  94. ;
  95. ;
  96. ;
  97. ;
  98. ;    R e a d e r   I n p u t.
  99. ;
  100. ;    Read the next character from the currently assigned
  101. ;    reader device into the A register.
  102. ;
  103. ;    EXIT    A = character read from the reader device.
  104.  
  105. READER:    IN    GBP1+GBSTAT    ;Input from port
  106.     ANI    GBDAV        ;Mask data available
  107.     JZ    READER        ;If data not available
  108.     IN    GBP1+GBDATA
  109.     RET
  110. ;
  111. ;
  112. ;
  113. ;
  114. ;    L i s t   O u t p u t.
  115. ;
  116. ;    Send a character to the list device.  If the list
  117. ;    device is not ready to receive a character wait
  118. ;    until the device is ready.
  119. ;
  120. ;    ENTRY    C = ASCII character to be output.
  121.  
  122. LIST:    IN    GBP1+GBSTAT    ;Get status
  123.     ANI    GBCC+GBTBMT
  124.     SUI    GBTBMT
  125.     JNZ    LIST
  126.     MOV    A,C
  127.     OUT    GBP1+GBDATA
  128.     RET
  129. ;
  130. ;
  131. ;
  132. ;
  133. ;    L i s t   S t a t u s.
  134. ;
  135. ;    Return the ready status for the list device.
  136. ;
  137. ;    EXIT    A = 0 (zero), list device is not ready to
  138. ;        accept another character.
  139. ;        A = FFh (255), list device is ready to accept
  140. ;        a character.
  141.  
  142. LISTST:
  143.     IN    GBP1+GBSTAT
  144.     ANI    GBCC+GBTBMT
  145.     SUI    GBTBMT
  146.     RZ            ;If ready
  147.     ORI    0FFh
  148.     RET
  149. ;
  150. ;
  151. ;
  152. ;    M P / M   F U N C T I O N S
  153. ;
  154. ;
  155. ;
  156. SELMEMORY:
  157. POLLDEVICE:
  158. STARTCLOCK:
  159. STOPCLOCK:
  160. EXITREGION:
  161. MAXCONSOLE:
  162. SYSTEMINIT:
  163. IDLE:
  164.     RET
  165. ;
  166. ;
  167. ;
  168. ;    O P T I O N A L   N O N - S T A N D A R D   F U N C T I O N S
  169. ;
  170. ;
  171. ;
  172. ;
  173. ;
  174. ;    S E T   S E C T O R   C O U N T
  175. ;
  176. ;    Set the number of continuous sectors to transfer.
  177. ;
  178. ;    ENTRY    C = Number of sectors to transfer.
  179. ;
  180. ;    EXIT    NUMSEC = C
  181.  
  182. SETNUM:
  183.     MOV    A,C
  184.     STA    NUMSEC
  185.     RET
  186. ;
  187. ;
  188. ;
  189. ;
  190. ;    S E T   E X T E N D E D   B A N K
  191. ;
  192. ;    Set the extended bank data tranfer address.
  193. ;
  194. ;    ENTRY    C = Extended address bank.
  195. ;
  196. ;    EXIT    DMAADE = C.
  197.  
  198. SETXAD:
  199.     MOV    A,C
  200.     STA    DMAADE
  201.     RET
  202. ;
  203. ;    COLD boot initialization
  204. ;
  205. ;Note:    The label URINIT defines the beginning of data storage
  206. ;
  207. URINIT:    RET
  208. ;
  209. ;
  210.