home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / YAEC / examples / bla.device.e < prev    next >
Encoding:
Text File  |  2001-02-23  |  1.3 KB  |  56 lines

  1. LIBRARY DEVICE 'bla.device', 37, 1, 'bla.device by nisse 2001'
  2.  
  3. /* NOTE1 : LIBRARY mode is not for beginners ! */
  4.  
  5. /* NOTE2 : DEVICE mode is for experts ! */
  6.  
  7. /* NOTE3 : we only have execbase opened for us */
  8.  
  9. /* NOTE4 : do NOT pass out exceptions from devicecode */
  10.  
  11. /* NOTE5 : filename of device will be src-filename without .e */
  12.  
  13. /* NOTE6 : this is just a very thin skeleton-device */
  14.  
  15. /* NOTE7 : it does not work as is, you have to code the rest */
  16.  
  17. /* NOTE8 : DEVICE mode is not tested yet ! */
  18.  
  19. /* the two required entries of a device, starting at -30 */
  20.  
  21. ENTRY BeginIO IS beginIO(A1) -> dont change
  22.  
  23. ENTRY AbortIO IS abortIO(A1) -> dont change
  24.  
  25.  
  26. /* the four required standard functions */
  27. /* see amiga dev cd x.x (RKM) for info about theese functions */
  28. /* for example, do NOT call functions that could break Forbid() ! */
  29.  
  30. PROC Init() -> gets called once (when loaded from disk) !
  31.    -> do stuff
  32. ENDPROC libbase  -> return base for success
  33.  
  34. PROC Open(iob, unitnum, flags) -> gets called on every OpenDevice() !
  35.    -> do stuff
  36. ENDPROC libbase  -> return base for success
  37.  
  38. PROC Close(iob) -> get called on every CloseDevice() !
  39.    -> do stuff
  40. ENDPROC
  41.  
  42. PROC Expunge() -> gets called once (when removed from mem) !
  43.    -> do stuff
  44. ENDPROC
  45.  
  46. /* empty device functions */
  47.  
  48. PROC beginIO(iob)
  49.   ->do stuff here
  50. ENDPROC
  51.  
  52. PROC abortIO(iob)
  53.    -> do stuff here
  54. ENDPROC
  55.  
  56.