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 / TTINST / DMATST.S < prev    next >
Encoding:
Text File  |  2001-02-09  |  950 b   |  51 lines

  1. .include "atari.s"
  2.  
  3. ;+
  4. ; To test dmarw()
  5. ;-
  6.  
  7. .globl    _dmarw
  8.  
  9. MAXSCSI    equ    15
  10. ;+
  11. ; For debugging purposes
  12. ; try reading root sector of all available ACSI and SCSI devices.
  13. ;-
  14. main:    Bconout    #2,#'*'        ; show that we're starting
  15.     Bconout    #2,#27
  16.     Bconout    #2,#'v'
  17.     _Super
  18.  
  19.     moveq    #MAXSCSI,d0    ; d0 = dev #
  20. next0:    move.w    d0,-(sp)
  21.     move.w    d0,-(sp)    ; dev #
  22.     move.l    #buf,-(sp)    ; buffer address
  23.     move.w    #1,-(sp)    ; count
  24.     move.l    #0,-(sp)    ; sector
  25.     move.w    #0,-(sp)    ; it's a read
  26.     bsr    _dmarw
  27.     tst.w    d0        ; successful
  28.     bne    fail0
  29.     Bconout    #2,#'S'        ; success!
  30.     bra    write0
  31. fail0:    Bconout    #2,#'F'        ; failure
  32.  
  33. write0:    move.w    #1,(sp)        ; it's a write
  34.     bsr    _dmarw
  35.     add.w    #14,sp        ; clean up stack
  36.     tst.w    d0        ; successful
  37.     bne    fail1
  38.     Bconout    #2,#'S'        ; success!
  39.     bra    next1
  40. fail1:    Bconout    #2,#'F'        ; failure
  41.  
  42. next1:    Bconout    #2,#' '        ; success!
  43.     move.w    (sp)+,d0
  44.     dbra    d0,next0
  45.  
  46.     Bconin    #2,#' '
  47.     Pterm0
  48.  
  49. .bss
  50. buf:    ds.b    512        ; buffer
  51.