home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / TESTSPAR / DOIT.S < prev    next >
Encoding:
Text File  |  2001-02-09  |  2.8 KB  |  139 lines

  1. ;+
  2. ; Edit History
  3. ;
  4. ; May-18-89    ml.    Started this.
  5. ; Aug-21-89    ml.    Added format code.
  6. ;-
  7.  
  8. .include    "defs.h"
  9.  
  10. .extern    _spscsixst
  11.  
  12. ;+
  13. ; doscmd() - send a simple command (no DMA involved)
  14. ;
  15. ; Passed:
  16. ;    d0.w = physical unit number
  17. ;    d2.w = command length (NCMD or LCMD)
  18. ;-
  19.     .globl    _doscmd
  20.     .extern    _smplacsi
  21.     .extern    _smplspscsi
  22.     .extern    _smplscsi
  23. _doscmd:
  24.     btst    #3,d0            ; SCSI unit?
  25.     bne.s    .0            ; if so, use the SCSI protocol
  26.     bsr    _smplacsi        ; else, use the ACSI protocol
  27.     bra.s    dosend
  28. .0:    tst.b    _spscsixst        ; Sparrow SCSI?
  29.     beq.s    .1            ; if not, it's regular SCSI
  30.     bsr    _smplspscsi
  31.     bra.s    dosend
  32. .1:    bsr    _smplscsi
  33. dosend:    rts
  34.  
  35.  
  36. ;+
  37. ; dorcmd() - send a command which will receive data from the target
  38. ;
  39. ; Passed:
  40. ;    d0.w = physical unit number
  41. ;    d1.l = transfer length (in bytes)
  42. ;    d2.w = command length (NCMD or LCMD)
  43. ;    a0.l = buffer address
  44. ;-
  45.     .globl    _dorcmd
  46.     .extern    _rcvacsi
  47.     .extern    _rcvspscsi
  48.     .extern    _rcvscsi
  49. _dorcmd:
  50.     btst    #3,d0            ; SCSI unit?
  51.     bne.s    .0            ; if so, use the SCSI protocol
  52.     bsr    _rcvacsi        ; else, use the ACSI protocol
  53.     bra.s    dorend
  54. .0:    tst.b    _spscsixst        ; Sparrow SCSI?
  55.     beq.s    .1            ; if not, it's regular SCSI
  56.     bsr    _rcvspscsi
  57.     bra.s    dorend
  58. .1:    bsr    _rcvscsi
  59. dorend:    rts
  60.  
  61.     
  62. ;+
  63. ; dowcmd() - send a command which will write data to the target
  64. ;
  65. ; Passed:
  66. ;    d0.w = physical unit number
  67. ;    d1.l = transfer length (in bytes)
  68. ;    d2.w = command length (NCMD or LCMD)
  69. ;    a0.l = buffer address
  70. ;-
  71.     .globl    _dowcmd
  72.     .extern    _wrtacsi
  73.     .extern    _wrtspscsi
  74.     .extern    _wrtscsi
  75. _dowcmd:
  76.     btst    #3,d0            ; SCSI unit?
  77.     bne.s    .0            ; if so, use the SCSI protocol
  78.     bsr    _wrtacsi        ; else, use the ACSI protocol
  79.     bra.s    dowend
  80. .0:    tst.b    _spscsixst        ; Sparrow SCSI?
  81.     beq.s    .1            ; if not, it's regular SCSI
  82.     bsr    _wrtspscsi
  83.     bra.s    dowend
  84. .1:    bsr    _wrtscsi
  85. dowend:    rts
  86.  
  87.     
  88.  
  89. .if    !DRIVER                ; not to be included in driver
  90.  
  91. ;+
  92. ; doformat() - format unit
  93. ;
  94. ; Passed:
  95. ;    d0.w = physical unit number
  96. ;    d2.w = command length (NCMD or LCMD)
  97. ;-
  98.     .globl    _doformat
  99.     .extern    _fmtacsi
  100.     .extern    _fmtspscsi
  101.     .extern    _fmtscsi
  102. _doformat:
  103.     btst    #3,d0            ; SCSI unit?
  104.     bne.s    .0            ; if so, use the SCSI protocol
  105.     bsr    _fmtacsi        ; else, use the ACSI protocol
  106.     bra.s    dofend
  107. .0:    tst.b    _spscsixst        ; Sparrow SCSI?
  108.     beq.s    .1            ; if not, it's regular SCSI
  109.     bsr    _fmtspscsi
  110.     bra.s    dofend
  111. .1:    bsr    _fmtscsi
  112. dofend:    rts
  113.  
  114.  
  115. ;+
  116. ; dostunit() - start or stop unit
  117. ;
  118. ; Passed:
  119. ;    d0.w = physical unit number
  120. ;    d2.w = command length (NCMD or LCMD)
  121. ;-
  122.     .globl    _dostunit
  123.     .extern    _stacsi
  124.     .extern    _stscsi
  125. _dostunit:
  126.     btst    #3,d0            ; SCSI unit?
  127.     bne.s    dostend            ; if so, use the SCSI protocol
  128. ;    bne.s    .0            ; if so, use the SCSI protocol
  129.     bsr    _stacsi            ; else, use the ACSI protocol
  130. ;    bra.s    dostend
  131. ;.0:    bsr    _stscsi
  132. dostend:
  133.     rts
  134.  
  135. .endif    ;!DRIVER
  136.  
  137.  
  138.  
  139.