home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / system / idev / v_i.asm < prev   
Assembly Source File  |  1988-01-02  |  1KB  |  41 lines

  1. **
  2. ** FILE:    vect_intfc.asm
  3. ** PROGRAM:    idev
  4. ** VERSION:    1.0
  5. **
  6. ** DESCRIPTIPON:
  7. **    This file contains idev_intfc(), the assembly language
  8. **    interface for the vect() function in idev.c.  It calls
  9. **    the vectnum-th library vector of the device associated
  10. **    with the IORequest.  The first vector is specified by
  11. **    vectnum 1.
  12. **
  13. **    The return value from the called vector is passed on
  14. **    as the return value of vect_intfc().
  15. **
  16. ** HISTORY:
  17. **    26-Aug-87    Original Version   (Ed Puckett)
  18. **
  19.  
  20.     INCLUDE "exec/types.i"
  21.     INCLUDE "exec/libraries.i"
  22.     INCLUDE "exec/io.i"
  23.  
  24.     XDEF    _vect_intfc    ; int  vect_intfc (req, vectnum)
  25.                 ; struct IORequest  *req;
  26.                 ; int            vectnum;    /* positive */
  27.  
  28. _vect_intfc:
  29.     movea.l 4(sp),a1        ; a1:req
  30.     move.l    8(sp),d0        ; d0:vectnum
  31.     movem.l d2-d7/a2-a6,-(sp)    ; save practically everything for safety
  32.     muls    #LIB_VECTSIZE,d0    ; d0:-offset
  33.     neg.l    d0            ; d0:offset
  34.     movea.l IO_DEVICE(a1),a6
  35.     jsr    0(a6,d0)        ; call the vector
  36.     movem.l (sp)+,d2-d7/a2-a6    ; restore protected registers
  37.     rts                ; return d0 as it came back from the call
  38.  
  39.     END
  40.  
  41.