home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / asm / SCSIDRV.ZIP / EQU.INC < prev    next >
Encoding:
Text File  |  1991-11-06  |  4.6 KB  |  173 lines

  1. ;
  2. ; Equates
  3. ;
  4. TRUE        EQU    001h
  5. FALSE        EQU    000h
  6.  
  7. DISK_REQUEST    EQU    000h        ;Disk I/O Request
  8. TAPE_REQUEST    EQU    001h        ;Tape I/O Request
  9.  
  10. ;
  11. ; Video Bus Monitoring
  12. ;
  13. VIDEO_SEG    EQU    0B800h
  14. VIDEO_OFS    EQU    79 * 2
  15. VIDEO_COLOR    EQU    00600h        ;Light Red
  16.  
  17. ;
  18. ; ST-01 Card Registers
  19. ;
  20. SCSI_CARD_SEG    EQU    0DE00h        ;Base Segment of Card
  21. SCSI_CMD_PORT    EQU    01A00h        ;Offset to Command Port
  22. SCSI_DATA_PORT    EQU    01C00h        ;Offset to Data Port
  23.  
  24. STACK_SIZE    EQU    1024        ;Our Local Stack
  25.  
  26. ;
  27. ; How the 16 bit sector number is broken down
  28. ; into a sector and cylinder number.
  29. ;
  30. ; x = Cylinder, y = track, always have only 1 head
  31. ;
  32. ; xxxx xxxx xxxx yyyy
  33. ;
  34.         if large_drives
  35. SECT_TRACK    EQU    16        ;Sectors per Track
  36. ROUND_CYL    EQU    0FFF0h        ;Round Sectors to nearest Cylinder
  37. CLUSTSIZE    EQU    8        ;Number of Sectors to a Cluster
  38.         else
  39. SECT_TRACK    EQU    16        ;Sectors per Track
  40. ROUND_CYL    EQU    0FFF0h        ;Round Sectors to nearest Cylinder
  41. CLUSTSIZE    EQU    4        ;Number of Sectors to a Cluster
  42. SECT_2_FS    EQU    10        ;How far to shift for
  43.                     ;Total Sectors to Fat Sectors
  44.         endif
  45.  
  46. ;
  47. ; The max target to check for (0-X).
  48. ; If using 'reserve_addr', this should not execede 6!
  49. ;
  50. MAXUNIT        EQU    6        ;Maximum Unit Number
  51.  
  52. P_SECT        EQU    512        ;Physical Sector Size
  53.  
  54. ;
  55. ; CHUNK_MASK is the maximum number of sectors to access in one
  56. ; SCSI request.  It MUST be a power of two, and CHUNK_MASK * P_SECT
  57. ; MUST be <= 64K to prevent segment wrap problems.
  58. ;
  59. CHUNK_MAX    EQU    32
  60.  
  61. CMDENABLE    EQU    080h        ;Enable the output drivers
  62. CMDENINTR    EQU    040h        ;Enable Interrupt
  63. CMDPARITY    EQU    020h        ;Enable Parity
  64. CMDSTARB    EQU    010h        ;Start Bus Arbitration
  65. CMDATTN        EQU    008h        ;Assert ATTN
  66. CMDBSY        EQU    004h        ;Assert BSY
  67. CMDSEL        EQU    002h        ;Assert SEL
  68. CMDRST        EQU    001h        ;Assert RST
  69.  
  70.         if scsi_parity
  71. CMDBASE        EQU    CMDPARITY    ;Base value of all commands
  72.         else
  73. CMDBASE        EQU    000h        ;Base value of all commands
  74.         endif
  75.  
  76. STARBCOMPL    EQU    080h        ;Arbitration Complete
  77. STPARERR    EQU    040h        ;Parity Error
  78. STSEL        EQU    020h        ;SEL Asserted
  79. STREQ        EQU    010h        ;REQ Asserted
  80. STCD        EQU    008h        ;C/D Asserted
  81. STIO        EQU    004h        ;I/O Asserted
  82. STMSG        EQU    002h        ;MSG Asserted
  83. STBSY        EQU    001h        ;BSY Asserted
  84.  
  85. REQ_MASK    EQU    STCD or STIO or STMSG
  86. REQ_DATAOUT    EQU    000h        ;Data Out Phase
  87. REQ_DATAIN    EQU    STIO        ;Data In Phase
  88. REQ_CMDOUT    EQU    STCD        ;Command Out Phase
  89. REQ_STATIN    EQU    STCD or STIO    ;Status In Phase
  90. REQ_MSGOUT    EQU    STMSG or STCD    ;Msg Out Phase
  91. REQ_MSGIN    EQU    STMSG or STCD or STIO ;Msg In Phase
  92.  
  93. COK        EQU    0        ;Command Completed OK
  94. CNOCONNECT    EQU    1        ;Unable to Connect to Target
  95. CBUSBUSY    EQU    2        ;Bus Busy
  96. CTIMEOUT    EQU    3        ;Timeout waiting for Response
  97. CERROR        EQU    4        ;Target Return Error
  98. CBUSY        EQU    5        ;Target was Busy
  99. CDISCONNECT    EQU    6        ;Target Disconnected
  100. COFFLINE    EQU    7        ;Target Went Offline
  101. CMSGOUT        EQU    8        ;Target Request Message Out???
  102. CPARERR        EQU    9        ;Parity Error Detected
  103. CSELERR        EQU    10        ;Re-Select Detected
  104.  
  105. SCSI_TESTREADY    EQU    000h        ;Test Unit Ready (6 byte)
  106. SCSI_REWIND    EQU    001h        ;Rewind (6 byte)
  107. SCSI_REQSENSE    EQU    003h        ;Request Sense (6 byte)
  108. SCSI_FORMATUNIT    EQU    004h        ;Format Disk (6 byte)
  109. SCSI_REASSIGN    EQU    007h        ;Reassign Bad Block (6 byte)
  110. SCSI_WRITEFM    EQU    010h        ;Write File Marks (6 byte)
  111. SCSI_SPACE    EQU    011h        ;Space Tape (6 byte)
  112. SCSI_INQUIRY    EQU    012h        ;Inquire (6 byte)
  113. SCSI_MODE_SET    EQU    015h        ;Mode Select (6 byte)
  114. SCSI_ERASE    EQU    019h        ;Erase Tape (6 byte)
  115. SCSI_MODE_GET    EQU    01Ah        ;Mode Sense (6 byte)
  116. SCSI_LOAD    EQU    01Bh        ;Load / Unload Tape (6 byte)
  117. SCSI_READSIZE    EQU    025h        ;Read Drive Capacity (10 byte)
  118.         if extended_io
  119. SCSI_READBLK    EQU    028h        ;Read Sectors (10 byte)
  120. SCSI_WRITEBLK    EQU    02Ah        ;Write Sectors (10 byte)
  121.         else
  122. SCSI_READBLK    EQU    008h        ;Read Sectors (6 byte)
  123. SCSI_WRITEBLK    EQU    00Ah        ;Write Sectors (6 byte)
  124.         endif
  125. SCSI_VERIFYBLK    EQU    02Fh        ;Verify Blocks (10 byte)
  126.  
  127. MSG_COMPLETE    EQU    000h        ;Command is Complete
  128. MSG_EXTEND    EQU    001h        ;Extended Message Follows
  129. MSG_SAVE    EQU    002h        ;Save Data Pointers
  130. MSG_RESTORE    EQU    003h        ;Restore Data Pointers
  131. MSG_DISCONNECT    EQU    004h        ;Disconnect Requested
  132. MSG_ERROR    EQU    005h        ;Error Detected
  133. MSG_ABORT    EQU    006h        ;Abort the Command
  134. MSG_REJECT    EQU    007h        ;Reject the Command
  135. MSG_NOP        EQU    008h        ;No Operation
  136. MSG_PARITY    EQU    009h        ;Parity Error Occured
  137. MSG_RESET    EQU    00Ch        ;Reset the Unit
  138. MSG_IDENTIFY    EQU    080h        ;Identify Yourself
  139.  
  140. ;
  141. ; Test Unit Ready Retry Count
  142. ;
  143. READY_RETRY    EQU    10        ;Wait 10 seconds for ready
  144.  
  145. ;
  146. ; Command Retry Count
  147. ;
  148. MAX_RETRY    EQU    3        ;Retry 3 times
  149.  
  150. ;
  151. ; Sense sub types
  152. ;
  153. SENSE_CCS    EQU    070h        ;Extended Sense Available
  154.  
  155. ;
  156. ; Format sub types
  157. ;
  158. FORMAT_NORMAL    EQU    000h        ;Format with known defect list
  159. FORMAT_ADDING    EQU    010h        ;Format with additional bad blocks
  160. FORMAT_ORIG    EQU    018h        ;Format with original bad block list
  161.  
  162. ;
  163. ; Load sub types
  164. ;
  165. LOAD_TAPE    EQU    001h        ;Load
  166. UNLOAD_TAPE    EQU    000h        ;Unload
  167.  
  168. ;
  169. ; We write one filemark at the end of a tape
  170. ; so that we can space forward over stuff.
  171. ;
  172. CLOSE_FM_CNT    EQU    001h
  173.