home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / lockdevice_371.lzh / LockDevice / IOHandler.asm < prev    next >
Assembly Source File  |  1990-10-08  |  957b  |  48 lines

  1. * $Revision Header * Header built automatically - do not edit! *************
  2. *
  3. *    (C) Copyright 1990 by MXM
  4. *
  5. *    Name .....: IOHandler.asm
  6. *    Created ..: Tuesday 26-Jun-90 14:19
  7. *    Revision .: 1
  8. *
  9. *    Date            Author          Comment
  10. *    =========       ========        ====================
  11. *    26-Jun-90       Olsen           Created this file!
  12. *
  13. * $Revision Header *********************************************************
  14.  
  15.     section    text,code
  16.  
  17.     include    "exec/types.i"
  18.     include    "exec/nodes.i"
  19.     include    "exec/io.i"
  20.  
  21.     xdef    _NewBeginIO
  22.     xref    _PatchedBeginIO
  23.     xref    _geta4
  24.  
  25. _NewBeginIO:
  26.  
  27.     movem.l    d1-d7/a2-a6,-(sp)        ; Save registers
  28.  
  29.     move.l    a1,-(sp)            ; Remember IORequest
  30.  
  31.     jsr    _geta4
  32.     jsr    _PatchedBeginIO            ; Call our patch
  33.  
  34.     move.l    (sp)+,a1            ; Restore IORequest
  35.  
  36.     movem.l    (sp)+,d1-d7/a2-a6        ; Restore registers
  37.  
  38.     tst.l    d0                ; Valid result?
  39.     bne    1$
  40.  
  41.     move.b    IO_ERROR(a1),d0            ; Return error
  42.     rts
  43.  
  44. 1$    move.l    d0,a0                ; Jump to original routine
  45.     jmp    (a0)
  46.  
  47.     end
  48.