pmodew.doc

来自「开放源码的编译器open watcom 1.6.0版的源代码」· DOC 代码 · 共 1,716 行 · 第 1/5 页

DOC
1,716
字号
2.8 - Function 000Ah - Create Alias Descriptor:
-----------------------------------------------

  Creates a new data descriptor that has the same base and limit as the
specified descriptor.

In:
  AX     = 000ah
  BX     = selector

Out:
  if successful:
    carry flag clear
    AX	   = data selector (alias)

  if failed:
    carry flag set

Notes:
) The selector supplied to the function may be either a data descriptor or
  a code descriptor. The alias descriptor created is always an expand-up
  writeable data segment.

) The descriptor alias returned by this function will not track changes to the
  original descriptor.

2.9 - Function 000Bh - Get Descriptor:
--------------------------------------

  Copies the descriptor table entry for the specified selector into an 8 byte
buffer.

In:
  AX     = 000bh
  BX     = selector
  ES:EDI = selector:offset of 8 byte buffer

Out:
  if successful:
    carry flag clear
    buffer pointed to by ES:EDI contains descriptor

  if failed:
    carry flag set

2.10 - Function 000Ch - Set Descriptor:
---------------------------------------

  Copies the contents of an 8 byte buffer into the descriptor for the
specified selector.

In:
  AX     = 000ch
  BX     = selector
  ES:EDI = selector:offset of 8 byte buffer containing descriptor

Out:
  if successful:
    carry flag clear

  if failed:
    carry flag set

) The descriptors access rights/type word at offset 5 within the descriptor
  follows the same format and restrictions as the access rights/type parameter
  CX to the Set Descriptor Access Rights function (0009h).

) Under DPMI 1.0/VCPI/XMS/raw, any segment register which contains the
  selector specified in register BX will be reloaded. DPMI 0.9 may do this,
  but it is not guaranteed.

) We hope you have enough sense not to try to modify your current CS or SS
  descriptor or the descriptor of the buffer.

2.11 - Function 0100h - Allocate DOS Memory Block:
--------------------------------------------------

  Allocates low memory through DOS function 48h and allocates it a descriptor.

In:
  AX     = 0100h
  BX     = paragraphs to allocate

Out:
  if successful:
    carry flag clear
    AX	   = real mode segment address
    DX	   = protected mode selector for memory block

  if failed:
    carry flag set
    AX	   = DOS error code
    BX	   = size of largest available block

2.12 - Function 0101h - Free DOS Memory Block:
----------------------------------------------

  Frees a low memory block previously allocated by function 0100h.

In:
  AX     = 0101h
  DX     = protected mode selector for memory block

Out:
  if successful:
    carry flag clear

  if failed:
    carry flag set
    AX	   = DOS error code

2.13 - Function 0102h - Resize DOS Memory Block:
------------------------------------------------

  Resizes a low memory block previously allocated by function 0100h

In:
  AX     = 0102h
  BX     = new block size in paragraphs
  DX     = protected mode selector for memory block

Out:
  if successful:
    carry flag clear

  if failed:
    carry flag set
    AX	   = DOS error code
    BX	   = size of largest available block

2.14 - Function 0200h - Get Real Mode Interrupt Vector:
-------------------------------------------------------

  Returns the real mode segment:offset for the specified interrupt vector.

In:
  AX     = 0200h
  BL     = interrupt number

Out:
  always successful:
    carry flag clear
    CX:DX  = segment:offset of real mode interrupt handler

Notes:
) The value returned in CX is a real mode segment address, not a protected
  mode selector.

2.15 - Function 0201h - Set Real Mode Interrupt Vector:
-------------------------------------------------------

  Sets the real mode segment:offset for the specified interrupt vector.

In:
  AX     = 0201h
  BL     = interrupt number
  CX:DX  = segment:offset of real mode interrupt handler

Out:
  always successful:
    carry flag clear

Notes:
) The value passed in CX must be a real mode segment address, not a protected
  mode selector. Consequently, the interrupt handler must either reside in
  DOS memory (below the 1M boundary) or the client must allocate a real mode
  callback address.

2.16 - Function 0202h - Get Processor Exception Handler Vector:
---------------------------------------------------------------

  Returns the address of the current protected mode exception handler for the
specified exception number.

In:
  AX     = 0202h
  BL     = exception number (00h-1fh)

Out:
  if successful:
    carry flag clear
    CX:EDX = selector:offset of exception handler

  if failed:
    carry flag set

Notes:
) PMODE/W handles exceptions under clean/XMS/VCPI environments. Under a DPMI
  environment, exception handling is provided by the DPMI host.

) PMODE/W only traps exceptions 0 through 14. The default behavior is to
  terminate execution and do a debug dump. PMODE/W will terminate on
  exceptions 0, 1, 2, 3, 4, 5, and 7, instead of passing them down to the
  real mode handlers as DPMI specifications state.

2.17 - Function 0203h - Set Processor Exception Handler Vector:
---------------------------------------------------------------

  Sets the address of a handler for a CPU exception or fault, allowing a
protected mode application to intercept processor exceptions.

In:
  AX     = 0203h
  BL     = exception number (00h-1fh)
  CX:EDX = selector:offset of exception handler

Out:
  if successful:
    carry flag clear

  if failed:
    carry flag set

Notes:
) PMODE/W handles exceptions under clean/XMS/VCPI environments. Under a DPMI
  environment, exception handling is provided by the DPMI host.

) PMODE/W only traps exceptions 0 through 14. The default behavior is to
  terminate execution and do a debug dump. PMODE/W will terminate on
  exceptions 0, 1, 2, 3, 4, 5, and 7, instead of passing them down to the
  real mode handlers as DPMI specifications state.

) If you wish to hook one of the low 8 interrupts, you must hook it as an
  exception. It will not be called if you hook it with function 0205h.

2.18 - Function 0204h - Get Protected Mode Interrupt Vector:
------------------------------------------------------------

  Returns the address of the current protected mode interrupt handler for the
specified interrupt.

In:
  AX     = 0204h
  BL     = interrupt number

Out:
  always successful:
    carry flag clear
    CX:EDX = selector:offset of protected mode interrupt handler

Notes:
) The value returned in CX is a valid protected mode selector, not a real mode
  segment address.

2.19 - Function 0205h - Set Protected Mode Interrupt Vector:
------------------------------------------------------------

  Sets the address of the protected mode interrupt handler for the specified
interrupt.

In:
  AX     = 0205h
  BL     = interrupt number
  CX:EDX = selector offset of protected mode interrupt handler

Out:
  if successful:
    carry flag clear

  if failed:
    carry flag set

Notes:
) The value passed in CX must be a valid protected mode selector, not a real
  mode segment address.

) If you wish to hook one of the low 8 interrupts, you must hook it as an
  exception. It will not be called if you hook it with function 0205h.

2.20 - Function 0300h - Simulate Real Mode Interrupt:
-----------------------------------------------------

  Simulates an interrupt in real mode. The function transfers control to the
address specified by the real mode interrupt vector. The real mode handler
must return by executing an IRET.

In:
  AX     = 0300h
  BL     = interrupt number
  BH     = must be 0
  CX     = number of words to copy from the protected mode stack to the real
           mode stack
  ES:EDI = selector:offset of real mode register data structure in the
           following format:

           Offset  Length  Contents
           00h     4       EDI
           04h     4       ESI
           08h     4       EBP
           0ch     4       reserved, ignored
           10h     4       EBX
           14h     4       EDX
           18h     4       ECX
           1ch     4       EAX
           20h     2       CPU status flags
           22h     2       ES
           24h     2       DS
           26h     2       FS
           28h     2       GS
           2ah     2       IP (reserved, ignored)
           2ch     2       CS (reserved, ignored)
           2eh     2       SP
           30h     2       SS

Out:
  if successful:
    carry flag clear
    ES:EDI = selector offset of modified real mode register data structure

  if failed:
    carry flag set

Notes:
) The CS:IP in the real mode register data structure is ignored by this
  function. The appropriate interrupt handler will be called based on the
  value passed in BL.

) If the SS:SP fields in the real mode register data structure are zero, a
  real mode stack will be provided by the host. Otherwise the real mode SS:SP
  will be set to the specified values before the interrupt handler is called.

) The flags specified in the real mode register data structure will be put on
  the real mode interrupt handler's IRET frame. The interrupt handler will be
  called with the interrupt and trace flags clear.

) Values placed in the segment register positions of the data structure must
  be valid for real mode. That is, the values must be paragraph addresses, not
  protected mode selectors.

) The target real mode handler must return with the stack in the same state
  as when it was called. This means that the real mode code may switch stacks
  while it is running, but must return on the same stack that it was called
  on and must return with an IRET.

) When this function returns, the real mode register data structure will
  contain the values that were returned by the real mode interrupt handler.
  The CS:IP and SS:SP values will be unmodified in the data structure.

) It is the caller's responsibility to remove any parameters that were pushed
  on the protected mode stack.

2.21 - Function 0301h - Call Real Mode Procedure With Far Return Frame:
-----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?