home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / dev / Misc / DLDTipsNTricks / Includes / LCR / LCR_Dos.i next >
Text File  |  1995-07-21  |  9KB  |  215 lines

  1.         IFND LCR_DOS_I
  2. LCR_DOS_I SET 1
  3.  
  4. ****************************************************************************
  5. ** Librarycall-include v1.0 written by Rasmus K. Ursem, Dreamline Designs **
  6. ** For the dos.library.                                                   **
  7. **                                                                        **
  8. ** This is an include to help assembler-programmers when accessing        **
  9. ** libraries. You probably know the situation where you just can't        **
  10. ** remember which registers a library call is using. This will aid you    **
  11. ** by the use of some logic. This include-file is build like this:        **
  12. ** All entries starts with the same as the library-calls name, e.g for    **
  13. ** dos/_LVORead() is the entries _LVORead_FH, _LVORead_Buffer and         **
  14. ** _LVORead_Size, and the result register is _LVORead_Result.             **
  15. ** An Example: Say You want to call dos/_LVORead() but cannot remember    **
  16. ** which registers is used for the input, but with some logic you guess   **
  17. ** that _LVORead() needs a Filehandle, a buffer and a size. And then it   **
  18. ** should be pretty easy to guess the names in the include.               **
  19. ****************************************************************************
  20. ** Some general names:                                                    **
  21. ** <Library-Call-Name>_Result         = the result register.              **
  22. ** <Library-Call-Name>_Result2        = the 2nd result register.          **
  23. ** <Library-Call-Name>_RFail          = the fail-value.                   **
  24. **                                      NOTE: This is a value NOT a reg.  **
  25. ** <Library-Call-Name>_RSuccess       = the success-value.                **
  26. **                                      NOTE: This is a value NOT a reg.  **
  27. **                                      a call will NEVER have both fail  **
  28. **                                      and success-values.               **      
  29. ** <Library-Call-Name>_Name           = ALWAYS a STRPTR to a name.        **
  30. **                                      E.g. a library-name.              **
  31. ** <Library-Call-Name>_FH             = ALWAYS a BPTR filehandle.         **
  32. ** <Library-Call-Name>_Lock           = ALWAYS a BPTR lock.               **
  33. ** <Library-Call-Name>_Size           = ALWAYS an ULONG size.             **
  34. ** <Library-Call-Name>_Length         = ALWAYS an ULONG size.             **
  35. ** <Library-Call-Name>_Buffer         = ALWAYS an APTR.                   **
  36. ** <Library-Call-Name>_Port           = A pointer to a msgport.           **
  37. ** <Library-Call-Name>_MsgPort        = A pointer to a msgport. Same as   **
  38. **                                      above. If a call needs 2 ports    **
  39. **                                      the other port will have a name   **
  40. **                                      like <LCN>_ReplyPort. In other    **
  41. **                                      words <LCN>_Port and              **
  42. **                                      <LCN>_MsgPort ALWAYS refer to the **
  43. **                                      same register.                    **
  44. **                                                                        **
  45. ** Furthermore you can use the following to check the amount of registers **
  46. ** used in a call. (If you cannot remember how many regs a call needs.)   **
  47. **                                                                        **
  48. ** <Library-Call-Name>_RU             = a number indicating how many regs **
  49. **                                      this call uses for INPUT.         **
  50. ****************************************************************************
  51. ** Example of use:                                                        **
  52. **                                                                        **
  53. **      ...                                                               **
  54. **      move.l  MyFileHandle,   _LVORead_FH                               **
  55. **      move.l  MyBufferPtr,    _LVORead_Buffer                           **
  56. **      move.l  #1000,          _LVORead_Size                             **
  57. **      move.l  DosBase,        a6                                        **
  58. **      jsr     _LVORead(a6)                                              **
  59. **                                                                        **
  60. **      cmpi.l  #_LVORead_RFail,_LVORead_Result                           **
  61. **      beq     CouldNotRead                                              **
  62. **      ...                                                               **
  63. **                                                                        **
  64. ****************************************************************************
  65.  
  66. ****************************************************************************
  67. ****************************************************************************
  68. ** dos.library                                                            **
  69. ****************************************************************************
  70. ****************************************************************************
  71.  
  72. *** _LVOAbortPkt() ***
  73. _LVOAbortPkt_Port       equr    d1
  74. _LVOAbortPkt_MsgPort    equr    d1
  75. _LVOAbortPkt_Packet     equr    d2
  76. _LVOAbortPkt_Pkt        equr    d2
  77. _LVOAbortPkt_RU         = 2
  78.  
  79. *** _LVOAllocDosObject() ***
  80. _LVOAllocDosObject_Type         equr    d1
  81. _LVOAllocDosObject_Tags         equr    d2
  82. _LVOAllocDosObject_Result       equr    d0
  83. _LVOAllocDosObject_RFail        = 0
  84. _LVOAllocDosObject_RU           = 2
  85.  
  86. *** _LVOClose() ***
  87. _LVOClose_File          equr    d1
  88. _LVOClose_FH            equr    d1
  89. _LVOClose_FileHandle    equr    d1
  90. _LVOClose_Result        equr    d0
  91. _LVOClose_RFail         = 0
  92. _LVOClose_RU            = 1
  93.  
  94. *** _LVODoPkt() ***
  95. _LVODoPkt_Port          equr    d1
  96. _LVODoPkt_MsgPort       equr    d1
  97. _LVODoPkt_Action        equr    d2
  98. _LVODoPkt_Arg1          equr    d3
  99. _LVODoPkt_Arg2          equr    d4
  100. _LVODoPkt_Arg3          equr    d5
  101. _LVODoPkt_Arg4          equr    d6
  102. _LVODoPkt_Arg5          equr    d7
  103. _LVODoPkt_Result        equr    d0
  104. _LVODoPkt_Result2       equr    d1
  105. _LVODoPkt_RFail         = 0
  106. _LVODoPkt_RU            = 7
  107.  
  108. *** _LVOExamine() ***
  109. _LVOExamine_Lock                equr d1
  110. _LVOExamine_Block               equr d2
  111. _LVOExamine_FIB                 equr d2
  112. _LVOExamine_FileInfoBlock       equr d2
  113. _LVOExamine_Result              equr d0
  114. _LVOExamine_RFail               = 0
  115. _LVOExamine_RU                  = 2
  116.  
  117. *** _LVOExamineFH() ***
  118. _LVOExamineFH_FH                  equr d1
  119. _LVOExamineFH_Block               equr d2
  120. _LVOExamineFH_FIB                 equr d2
  121. _LVOExamineFH_FileInfoBlock       equr d2
  122. _LVOExamineFH_Result              equr d0
  123. _LVOExamineFH_RFail               = 0
  124. _LVOExamineFH_RU                  = 2
  125.  
  126. *** _LVOExNext() ***
  127. _LVOExNext_Lock                equr d1
  128. _LVOExNext_Block               equr d2
  129. _LVOExNext_FIB                 equr d2
  130. _LVOExNext_FileInfoBlock       equr d2
  131. _LVOExNext_Result              equr d0
  132. _LVOExNext_RFail               = 0
  133. _LVOExNext_RU                  = 2
  134.  
  135. *** _LVOFreeDosObject() ***
  136. _LVOFreeDosObject_Type          equr    d1
  137. _LVOFreeDosObject_Object        equr    d2
  138. _LVOFreeDosObject_Ptr           equr    d2
  139. _LVOFreeDosObject_Pointer       equr    d2
  140. _LVOFreeDosObject_RU            = 2
  141.  
  142. *** _LVOGetConsoleTask() ***
  143. _LVOGetConsoleTask_Result       equr    d0
  144. _LVOGetConsoleTask_RFail        = 0
  145. _LVOGetConsoleTask_RU           = 0
  146.  
  147. *** _LVOInput() ***
  148. _LVOInput_Result        equr d0
  149. _LVOInput_RU            =0
  150.  
  151. *** _LVOLock() ***
  152. _LVOLock_Name           equr d1
  153. _LVOLock_Mode           equr d2
  154. _LVOLock_AccessMode     equr d2
  155. _LVOLock_Result         equr d0
  156. _LVOLock_RFail          = 0
  157. _LVOLock_RU             = 2
  158.  
  159. *** _LVOOutput() ***
  160. _LVOOutput_Result       equr d0
  161. _LVOOutput_RU           = 0
  162.  
  163. *** _LVOOpen() ***
  164. _LVOOpen_Name           equr    d1
  165. _LVOOpen_Mode           equr    d2
  166. _LVOOpen_AccessMode     equr    d2
  167. _LVOOpen_Result         equr    d0
  168. _LVOOpen_RFail          = 0
  169. _LVOOpen_RU             = 2
  170.  
  171. *** _LVORead() ***
  172. _LVORead_FH     equr d1
  173. _LVORead_Buffer equr d2
  174. _LVORead_Size   equr d3
  175. _LVORead_Lenght equr d3
  176. _LVORead_Result equr d0
  177. _LVORead_RFail = 0
  178. _LVORead_RU       = 3
  179.  
  180. *** _LVOSeek() ***
  181. _LVOSeek_FH             equr    d1
  182. _LVOSeek_Position       equr    d2
  183. _LVOSeek_Pos            equr    d2
  184. _LVOSeek_Mode           equr    d3
  185. _LVOSeek_Offset         equr    d3
  186. _LVOSeek_Result         equr    d0
  187. _LVOSeek_RU             = 3
  188.  
  189. *** _LVOSendPkt() ***
  190. _LVOSendPkt_Packet      equr    d1
  191. _LVOSendPkt_Pkt         equr    d1
  192. _LVOSendPkt_Port        equr    d2
  193. _LVOSendPkt_MsgPort     equr    d2
  194. _LVOSendPkt_ReplyPort   equr    d3
  195. _LVOSendPkt_RU          = 3
  196.  
  197. *** _LVOWrite() ***
  198. _LVOWrite_FH     equr d1
  199. _LVOWrite_Buffer equr d2
  200. _LVOWrite_Size   equr d3
  201. _LVOWrite_Lenght equr d3
  202. _LVOWrite_Result equr d0
  203. _LVOWrite_RFail = 0
  204. _LVOWrite_RU       = 3
  205.  
  206. *** _LVOUnLock() ***
  207. _LVOUnLock_Lock         equr d1
  208. _LVOUnLock_RU           = 0
  209.  
  210. *** _LVOWaitPkt() ***
  211. _LVOWaitPkt_Result      equr    d0
  212. _LVOWaitPkt_RU          = 0
  213.  
  214.         ENDC
  215.