home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bootp.zip / WRTVCT.ASM < prev    next >
Assembly Source File  |  1989-12-15  |  896b  |  57 lines

  1. PAGE    66,132
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. ;  wrtvct.asm
  11. ;
  12. ;  usage:
  13. ;        extern wrtvct();
  14. ;        wrtvct( vectnum, offset, segment );
  15. ;
  16. ;  Function to allow a C program to set an interrupt vector
  17. ;
  18. ;  (c) 1984 University of Waterloo,
  19. ;           Faculty of Engineering,
  20. ;           Engineering Microcomputer Network Development Office
  21. ;
  22. ;  version
  23. ;
  24.     include masmdefs.hsm
  25.     include    model.hsm
  26.  
  27. codedef WRTVCT
  28. datadef
  29.  
  30. cstart  WRTVCT
  31. cpublic wrtvct
  32.  
  33.     push    si
  34.     push    ES
  35.  
  36.     mov    SI,+@AB+0[BP]        ;get vector number
  37.     shl    SI,1
  38.     shl    SI,1            ;* 4
  39.     xor    AX,AX
  40.     mov    ES,AX            ;ES:SI now pointer to the vector
  41.     mov    AX,+@AB+2[BP]        ;offset
  42.     mov    BX,+@AB+4[BP]        ;segment
  43.  
  44.     pushf
  45.     cli                ;disable interrupts
  46.     mov    ES:[SI],AX
  47.     mov    ES:+2[SI],BX
  48.     popf                ;restore ints
  49.  
  50.     pop    ES
  51.     pop    si
  52.  
  53. creturn wrtvct
  54. cend    WRTVCT
  55.  
  56.         end
  57.