home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: AssemPro For Development Amiga Driver / Lowe_AssemProForDevelopmentAmigaDriver.adf / Includes / libraries / dos.i < prev    next >
Encoding:
Text File  |  1978-06-06  |  6.8 KB  |  176 lines

  1. ; Standard assembler header for Amiga DOS on the MC68000   
  2.  
  3.    IFND LIBRARIES_DOS_I@
  4. LIBRARIES_DOS_I@            =      1
  5.  
  6. ;      IFND EXEC_TYPES_I@
  7. ;      INCLUDE "exec/types.i"
  8. ;      ENDIF
  9.  
  10.  
  11. DOSNAME     MACRO
  12.       DC.B  'dos.library',0
  13.       ENDM
  14.  
  15. ; Predefined Amiga DOS global constants 
  16.  
  17. ; Mode parameter to Open() 
  18. MODE_OLDFILE         EQU   1005   ; Open existing file read/write 
  19. ;                                 ; positioned at beginning of file. 
  20. MODE_NEWFILE         EQU   1006   ; Open freshly created file (delete 
  21. ;                                 ; old file) read/write            
  22.  
  23. ; Relative position to Seek() 
  24. OFFSET_BEGINNING     EQU   -1     ; relative to Beginning Of File 
  25. OFFSET_CURRENT       EQU    0     ; relative to Current file position 
  26. OFFSET_END           EQU    1     ; relative to End Of File    
  27.  
  28. OFFSET_BEGINING     EQU   OFFSET_BEGINNING     ; Ancient compatibility
  29.  
  30. BITSPERBYTE          EQU   8
  31. BYTESPERLONG         EQU   4
  32. BITSPERLONG          EQU   32
  33. MAXINT               EQU   $7FFFFFFF
  34. MININT               EQU   $80000000
  35.  
  36. ; Passed as type to Lock() 
  37. SHARED_LOCK          EQU   -2   ; File is readable by others 
  38. ACCESS_READ          EQU   -2   ; Synonym
  39. EXCLUSIVE_LOCK       EQU   -1   ; No other access allowed    
  40. ACCESS_WRITE         EQU   -1   ; Synonym
  41.  
  42.  
  43.  STRUCTURE DateStamp,0 
  44.    LONG  ds_Days                ; Number of days since Jan. 1, 1978
  45.    LONG  ds_Minute              ; Number of minutes past midnight 
  46.    LONG  ds_Tick                ; Number of ticks past minute 
  47.    LABEL ds_SIZEOF              ; DateStamp 
  48. TICKS_PER_SECOND EQU 50         ; Number of ticks in one second 
  49.  
  50. ; Returned by Examine() and ExInfo() 
  51.  STRUCTURE FileInfoBlock,0
  52.    LONG   fib_DiskKey
  53.    LONG   fib_DirEntryType      ; Type of Directory. If < 0, then a plain file.
  54.                                 ; If > 0 a directory 
  55.    STRUCT fib_FileName,108      ; Null terminated. Max 30 chars used for now 
  56.    LONG   fib_Protection        ; bit mask of protection, rwxd are 3-0.      
  57.    LONG   fib_EntryType
  58.    LONG   fib_Size              ; Number of bytes in file 
  59.    LONG   fib_NumBlocks         ; Number of blocks in file 
  60.    STRUCT fib_DateStamp,ds_SIZEOF ; Date file last changed.
  61.    STRUCT fib_Comment,116       ; Null terminated. Comment associated with file 
  62.    LABEL  fib_SIZEOF            ; FileInfoBlock 
  63.  
  64. ; FIB stands for FileInfoBlock 
  65. ; FIBB are bit definitions, FIBF are field definitions 
  66. ;   BITDEF   FIB,ARCHIVE,4       ; cleared whenever file is changed
  67. FIBB_ARCHIVE = 4       ; cleared whenever file is changed
  68. FIBF_ARCHIVE = 1<<4       ; cleared whenever file is changed
  69. ;   BITDEF   FIB,READ,3          ; ignored by the system
  70. FIBB_READ = 3          ; ignored by the system
  71. FIBF_READ = 1<<3          ; ignored by the system
  72. ;   BITDEF   FIB,WRITE,2         ; ignored by the system
  73. FIBB_WRITE = 2         ; ignored by the system
  74. FIBF_WRITE = 1<<2         ; ignored by the system
  75. ;   BITDEF   FIB,EXECUTE,1       ; ignored by the system
  76. FIBB_EXECUTE = 1       ; ignored by the system
  77. FIBF_EXECUTE = 1<<1       ; ignored by the system
  78. ;   BITDEF   FIB,DELETE,0        ; prevent file from being deleted
  79. FIBB_DELETE = 0        ; prevent file from being deleted
  80. FIBF_DELETE = 1<<0        ; prevent file from being deleted
  81.  
  82.  
  83. ; All BCPL data must be long word aligned.  BCPL pointers are the long word
  84. ; address (i.e byte address divided by 4 (>>2))
  85.  
  86. ; Macro to indicate BCPL pointers
  87. BPTR     MACRO    $\1                  ; Long word pointer
  88.          LONG     \1
  89.          ENDM
  90. BSTR     MACRO    $\1                  ; Long word pointer to BCPL string.
  91.          LONG     \1
  92.          ENDM
  93.  
  94. ; #define BADDR( bptr ) (bptr << 2) ; Convert BPTR to byte addressed pointer
  95.  
  96. ; BCPL strings have a length in the first byte and then the characters.
  97. ; For example:  s[0]=3 s[1]=S s[2]=Y s[3]=S
  98.  
  99. ; returned by Info() 
  100.  STRUCTURE InfoData,0
  101.    LONG id_NumSoftErrors        ; number of soft errors on disk 
  102.    LONG id_UnitNumber           ; Which unit disk is (was) mounted on 
  103.    LONG id_DiskState            ; See defines below 
  104.    LONG id_NumBlocks            ; Number of blocks on disk 
  105.    LONG id_NumBlocksUsed        ; Number of block in use 
  106.    LONG id_BytesPerBlock   
  107.    LONG id_DiskType             ; Disk Type code
  108.    BPTR id_VolumeNode           ; BCPL pointer to volume node
  109.    LONG id_InUse                ; Flag, zero if not in use
  110.    LABEL id_SIZEOF              ; InfoData 
  111.  
  112. ; ID stands for InfoData 
  113. ;            Disk states
  114. ID_WRITE_PROTECTED      EQU     80      ; Disk is write protected 
  115. ID_VALIDATING           EQU     81      ; Disk is currently being validated 
  116. ID_VALIDATED            EQU     82      ; Disk is consistent and writeable 
  117. ;          Disk types 
  118. ID_NO_DISK_PRESENT      EQU -1
  119. ID_UNREADABLE_DISK      EQU  ('B'<<24)|('A'<<16)|('D'<<8)
  120. ID_NOT_REALLY_DOS       EQU  ('N'<<24)|('D'<<16)|('O'<<8)|('S')
  121. ID_DOS_DISK             EQU  ('D'<<24)|('O'<<16)|('S'<<8)
  122. ID_KICKSTART_DISK       EQU  ('K'<<24)|('I'<<16)|('C'<<8)|('K')
  123.  
  124. ; Errors from IoErr(), etc. 
  125. ERROR_NO_FREE_STORE               EQU  103
  126. ERROR_TASK_TABLE_FULL             EQU  105
  127. ERROR_LINE_TOO_LONG               EQU  120
  128. ERROR_FILE_NOT_OBJECT             EQU  121
  129. ERROR_INVALID_RESIDENT_LIBRARY    EQU  122
  130. ERROR_OBJECT_IN_USE               EQU  202
  131. ERROR_OBJECT_EXISTS               EQU  203
  132. ERROR_OBJECT_NOT_FOUND            EQU  205
  133. ERROR_ACTION_NOT_KNOWN            EQU  209
  134. ERROR_INVALID_COMPONENT_NAME      EQU  210
  135. ERROR_INVALID_LOCK                EQU  211
  136. ERROR_OBJECT_WRONG_TYPE           EQU  212
  137. ERROR_DISK_NOT_VALIDATED          EQU  213
  138. ERROR_DISK_WRITE_PROTECTED        EQU  214
  139. ERROR_RENAME_ACROSS_DEVICES       EQU  215
  140. ERROR_DIRECTORY_NOT_EMPTY         EQU  216
  141. ERROR_DEVICE_NOT_MOUNTED          EQU  218
  142. ERROR_SEEK_ERROR                  EQU  219
  143. ERROR_COMMENT_TOO_BIG             EQU  220   
  144. ERROR_DISK_FULL                   EQU  221
  145. ERROR_DELETE_PROTECTED            EQU  222
  146. ERROR_WRITE_PROTECTED             EQU  223 
  147. ERROR_READ_PROTECTED              EQU  224
  148. ERROR_NOT_A_DOS_DISK              EQU  225
  149. ERROR_NO_DISK                     EQU  226
  150. ERROR_NO_MORE_ENTRIES             EQU  232
  151.  
  152. ; These are the return codes used by convention by AmigaDOS commands 
  153. ; See FAILAT and IF for relvance to EXECUTE files                    
  154. RETURN_OK                         EQU    0  ; No problems, success 
  155. RETURN_WARN                       EQU    5  ; A warning only 
  156. RETURN_ERROR                      EQU   10  ; Something wrong 
  157. RETURN_FAIL                       EQU   20  ; Complete or severe failure
  158.  
  159. ; Bit numbers that signal you that a user has issued a break
  160. ;        BITDEF  SIGBREAK,CTRL_C,12
  161. SIGBREAKB_CTRL_C = 12
  162. SIGBREAKF_CTRL_C = 1<<12
  163. ;        BITDEF  SIGBREAK,CTRL_D,13
  164. SIGBREAKB_CTRL_D = 13
  165. SIGBREAKF_CTRL_D = 1<<13
  166. ;        BITDEF  SIGBREAK,CTRL_E,14
  167. SIGBREAKB_CTRL_E = 14
  168. SIGBREAKF_CTRL_E = 1<<14
  169. ;        BITDEF  SIGBREAK,CTRL_F,15
  170. SIGBREAKB_CTRL_F = 15
  171. SIGBREAKF_CTRL_F = 1<<15
  172.  
  173.    ENDIF
  174.    END
  175.