calldvr.asm
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:2k
源码类别:

操作系统开发

开发平台:

Visual C++

  1. ;***
  2. ;* $Workfile:   calldvr.asm  $
  3. ;* $Revision:   1.1  $
  4. ;*   $Author:   Dave Sewell  $
  5. ;*     $Date:   27 Jun 1989 14:55:26  $
  6. ;***
  7.                 TITLE   Call device driver routine
  8.                 PAGE    66, 132
  9. COMMENT @
  10.     calldvr.asm : Alan Butt : January 8, 1989 : Expansion Box Project
  11.     This function calls a device driver
  12.     Inputs:
  13.         rhp     Far pointer to the request header
  14.         header  Far pointer to the device driver header
  15.     Outputs:    None
  16.         The called driver may make changes to rhp
  17. ;   extern void call_driver(void far *rhp, struct device_header far *header);
  18. @
  19. device_header   STRUC                   ; Device header structure
  20.     next_header dd  ?                   ; Link to next driver
  21.     attribute   dw  ?                   ; Device driver attribute word
  22.     strategy    dw  ?                   ; Offset to strategy entry point
  23.     inter       dw  ?                   ; Offset to interrupt entry point
  24.     name_num    db  8 DUP (?)           ; Device name or number of units
  25. device_header   ENDS
  26. %               .MODEL  memmodel, language
  27.                 .DATA
  28. addr            dd      ?
  29.                 .CODE
  30. call_driver     PROC    rhp:FAR PTR, header:FAR PTR device_header
  31.                 les     bx, header      ; Get address of strategy routine
  32.                 mov     bx, es:[bx].strategy
  33.                 mov     WORD PTR addr, bx
  34.                 mov     WORD PTR addr + 2, es
  35.                 les     bx, rhp         ; point to the rhp and
  36.                 call    addr            ; call the strategy routine
  37.                 les     bx, header      ; Get address of interrupt routine
  38.                 mov     bx, es:[bx].inter
  39.                 mov     WORD PTR addr, bx
  40.                 mov     WORD PTR addr + 2, es
  41.                 call    addr            ; Call the interrupt routine
  42.                 ret
  43. call_driver     ENDP
  44.                 END