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 / TTFHDX / AT.H < prev    next >
Encoding:
Text File  |  2001-02-09  |  3.0 KB  |  110 lines

  1. ;+
  2. ; Edit History
  3. ;
  4. ; Sep-05-90    ml.    Definitions of constants for the AT disk interface
  5. ;            (wrt PrairieTek 120 drive.)
  6. ;-
  7.  
  8.  
  9.  
  10. ; Command codes for AT disk interface
  11.  
  12. RECAL        equ    $10        ; Recalibrate
  13. READ        equ    $20        ; Read Sector(s)
  14. WRITE        equ    $30        ; Write Sector(s)
  15. VERIFY        equ    $40        ; Read Verify Sector(s)
  16. FMTTRK        equ    $50        ; Format Track
  17. SEEK        equ    $70        ; Seek
  18. DIAG        equ    $90        ; Execute Drive Diagnostic
  19. INITPARM    equ    $91        ; Initialize Drive Parameters
  20. RSBUF        equ    $e4        ; Read Sector Buffer
  21. WSBUF        equ    $e8        ; Write Sector Buffer
  22. IDENTIFY    equ    $ec        ; Identify Drive
  23.                     ; Standby Commands
  24. STANDBY        equ    $e0        ; go to STANDBY mode
  25. ACTIVE        equ    $e1        ; go to ACTIVE mode
  26. SBWTO        equ    $e2        ; StandBy mode With Time-Out
  27. AWTO        equ    $e3        ; Active mode With Time-Out
  28. SSC        equ    $e5        ; Set Sector Count wrt current mode
  29. SBRES        equ    $e6        ; StandBy until RESet
  30.  
  31.  
  32.  
  33. ; Command Modifiers
  34.  
  35. NO_RETRIES    equ    $01        ; no retries
  36. LCMD        equ    $02        ; long command
  37.  
  38.  
  39.  
  40. ; Time-outs
  41. D_WORST        equ    2000        ; worst case delay (10s)
  42.  
  43.  
  44.  
  45. GPIP        equ    $fffffa01
  46.  
  47. ; AT disk interface I/O locations for Read functions
  48.  
  49. bAT    equ    $FFF00000+REGBASE    ; base address
  50.  
  51. ATDR    equ    bAT-REGBASE+($00*REGLSTEP); Data Register (16-bit reg)
  52. ATER    equ    bAT+($01*REGLSTEP)    ; Error Register
  53. ATSC    equ    bAT+($02*REGLSTEP)    ; Sector Count
  54. ATSN    equ    bAT+($03*REGLSTEP)    ; Sector Number
  55. ATCL    equ    bAT+($04*REGLSTEP)    ; Cylinder Low
  56. ATCH    equ    bAT+($05*REGLSTEP)    ; Cylinder High (2 bits)
  57. ATSDH    equ    bAT+($06*REGLSTEP)    ; SDH register
  58. ATSR    equ    bAT+($07*REGLSTEP)    ; Status Register
  59. ATASR    equ    bAT+($0E*REGLSTEP)    ; Alternate Status Register
  60. ATDAR    equ    bAT+($0F*REGLSTEP)    ; Drive Address Register
  61.  
  62.  
  63.  
  64. ; AT disk interface I/O locations for Write functions
  65.  
  66. ;ATDR    equ    bAT-REGBASE+($00*REGLSTEP); Data Register (16-bit reg)
  67. ATWPR    equ    bAT+($01*REGLSTEP)    ; Write Precomp Register (not used)
  68. ;ATSC    equ    bAT+($02*REGLSTEP)    ; Sector Count
  69. ;ATSN    equ    bAT+($03*REGLSTEP)    ; Sector Number
  70. ;ATCL    equ    bAT+($04*REGLSTEP)    ; Cylinder Low
  71. ;ATCH    equ    bAT+($05*REGLSTEP)    ; Cylinder High (2 bits)
  72. ;ATSDH    equ    bAT+($06*REGLSTEP)    ; SDH register
  73. ATCR    equ    bAT+($07*REGLSTEP)    ; Command Register
  74. ATDOR    equ    bAT+($0E*REGLSTEP)    ; Digital Output Register
  75.  
  76.  
  77.  
  78. ; Bit assignments in Error Register
  79.  
  80. BBK        equ    7        ; 1: bad block detected
  81. UNC        equ    6        ; 1: non-correctable data error
  82. ;        equ    5        ; not used
  83. IDNF        equ    4        ; 1: requested ID not found
  84. ;        equ    3        ; not used
  85. ABRT        equ    2        ; 1: aborted command error
  86. TK0        equ    1        ; 1: track 0 not found error
  87. DMNF        equ    0        ; 1: data mark not found
  88.  
  89.  
  90.  
  91. ; Bit assignments in Status Register
  92.  
  93. BSY        equ    7        ; 1: drive busy
  94. DRDY        equ    6        ; 1: drive ready
  95. DWF        equ    5        ; 1: write fault detected
  96. DSC        equ    4        ; 1: actuator on track
  97. DRQ        equ    3        ; 1: ready to transfer
  98. CORR        equ    2        ; 1: data error corrected
  99. IDX        equ    1        ; 1: disk revolution completed
  100. ERR        equ    0        ; 1: error occurred
  101.  
  102.     
  103. ; Byte indices into buffer return by the Identify command
  104.  
  105. NCYL    equ    2        ; Number of fixed cylinders
  106. NHEAD    equ    6        ; Number of heads
  107. NSPT    equ    12        ; Number of physical sectors/track
  108.  
  109.  
  110.