home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol050 / sbc < prev    next >
Encoding:
Text File  |  1984-04-29  |  3.3 KB  |  207 lines

  1.  
  2.  
  3. ;    Intel SBC 80/30 Single board computer I/O equates.
  4.  
  5. CNIN:    EQU    0ECh        ;Console input channel
  6. CNOUT:    EQU    0ECh        ;Console output channel
  7. CONSTS:    EQU    0EDh        ;Console staus channel
  8.  
  9. TRDY:    EQU    001h        ;output status mask
  10. RBR:    EQU    002h        ;Input staus mask
  11.  
  12. PIT:    EQU    0DEh        ;Programmable interval timmer
  13. ;
  14. ;
  15. ;
  16. ;
  17. ;    C O N S O L   S T A T U S
  18. ;
  19. ;    This routine samples the Console status and returns the
  20. ;    following values in the A register.
  21. ;
  22. ;    EXIT    A = 0 (zero), means no character
  23. ;        currently ready to read.
  24. ;
  25. ;        A = FFh (255), means character
  26. ;        currently ready to read.
  27.  
  28. CONST:    IN    CONSTS        ;Input from port
  29.     ANI    RBR        ;Mask data available
  30.     RZ            ;If data not available
  31.     ORI    0FFh
  32.     RET
  33. ;
  34. ;
  35. ;
  36. ;
  37. ;    C O N S O L   I N P U T
  38. ;
  39. ;    Read the next character into the A register, clearing
  40. ;    the high order bit.  If no character currently ready to
  41. ;    read then wait for a character to arrive before returning.
  42. ;
  43. ;    EXIT    A = character read from terminal.
  44.  
  45. CONIN:    IN    CONSTS        ;get staus
  46.     ANI    RBR
  47.     JZ    CONIN        ;If data not available
  48.     IN    CNIN        ;Get data byte
  49.     ANI    7Fh
  50.     RET
  51. ;
  52. ;
  53. ;
  54. ;
  55. ;    C O N S O L   O U T P U T
  56. ;
  57. ;    Send a character to the console.  If the console
  58. ;    is not ready to receive a character wait until
  59. ;    the console is ready.
  60. ;
  61. ;    ENTRY    C = ASCII character to output to console.
  62.  
  63. CONOUT:    IN    CONSTS        ;Get staus byte
  64.     ANI    TRDY
  65.     JZ    CONOUT        ;If transmit buffer not empty
  66.     MOV    A,C
  67.     OUT    CNOUT
  68.     RET
  69. ;
  70. ;
  71. ;
  72. ;
  73. ;    P u n c h   O u t p u t.
  74. ;
  75. ;    Send a character to the punch device.  If no punch
  76. ;    device exists then immediately return.
  77. ;
  78. ;    ENTRY    C = ASCII character to output.
  79.  
  80. PUNCH:
  81.     RET
  82. ;
  83. ;
  84. ;
  85. ;
  86. ;    R e a d e r   I n p u t.
  87. ;
  88. ;    Read the next character from the currently assigned
  89. ;    reader device into the A register.
  90. ;
  91. ;    EXIT    A = character read from the reader device.
  92.  
  93. READER:
  94.     RET
  95. ;
  96. ;
  97. ;
  98. ;
  99. ;    L i s t   O u t p u t.
  100. ;
  101. ;    Send a character to the list device.  If the list
  102. ;    device is not ready to receive a character wait
  103. ;    until the device is ready.
  104. ;
  105. ;    ENTRY    C = ASCII character to be output.
  106.  
  107. LIST:
  108.     RET
  109. ;
  110. ;
  111. ;
  112. ;
  113. ;    L i s t   S t a t u s.
  114. ;
  115. ;    Return the ready status for the list device.
  116. ;
  117. ;    EXIT    A = 0 (zero), list device is not ready to
  118. ;        accept another character.
  119. ;        A = FFh (255), list device is ready to accept
  120. ;        a character.
  121. ;
  122. LISTST:
  123.     XRA    A        ;FORCE LIST NOT READY
  124.     RET
  125. ;
  126. ;
  127. ;
  128. ;   M P / M   F U N C T I O N S
  129. ;
  130. ;
  131. ;
  132. SELMEMORY:
  133. POLLDEVICE:
  134. STARTCLOCK:
  135. STOPCLOCK:
  136. EXITREGION:
  137. MAXCONSOLE:
  138. SYSTEMINIT:
  139. IDLE:
  140.     RET
  141. ;
  142. ;
  143. ;
  144. ;
  145. ;
  146. ;
  147. ;
  148. ;
  149. ;
  150. ;
  151. ;
  152. ;    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
  153. ;
  154. ;
  155. ;
  156. ;
  157. ;
  158. ;    S E T   S E C T O R   C O U N T
  159. ;
  160. ;    Set the number of continuous sectors to transfer.
  161. ;
  162. ;    ENTRY    C = Number of sectors to transfer.
  163. ;
  164. ;    EXIT    NUMSEC = C
  165.  
  166. SETNUM:
  167.     MOV    A,C
  168.     STA    NUMSEC
  169.     RET
  170. ;
  171. ;
  172. ;
  173. ;
  174. ;    S E T   E X T E N D E D   B A N K
  175. ;
  176. ;    Set the extended bank data tranfer address.
  177. ;
  178. ;    ENTRY    C = Extended address bank.
  179. ;
  180. ;    EXIT    DMAADE = C.
  181.  
  182. SETXAD:
  183.     MOV    A,C
  184.     STA    DMAADE
  185.     RET
  186. ;
  187. ;
  188. ;
  189. ;    COLD boot initialization
  190. ;
  191. ;Note: The label URINIT defines the beginning of data storage.
  192. ;
  193. URINIT:    MVI    A,0B6h        ;Set PIT for 9600 baud
  194.     OUT    PIT+1
  195.     MVI    A,008h
  196.     OUT    PIT+0
  197.     MVI    A,00
  198.     OUT    PIT+0
  199.     MVI    A,04Eh        ;Setup serial port
  200.     OUT    CONSTS
  201.     MVI    A,037h
  202.     OUT    CONSTS
  203.     IN    CNIN
  204.     RET
  205. ;
  206. ;
  207.