pmodew.doc
来自「开放源码的编译器open watcom 1.6.0版的源代码」· DOC 代码 · 共 1,716 行 · 第 1/5 页
DOC
1,716 行
Allocates a block of extended memory.
In:
AX = 0501h
BX:CX = size of block in bytes (must be non-zero)
Out:
if successful:
carry flag clear
BX:CX = linear address of allocated memory block
SI:DI = memory block handle (used to resize and free block)
if failed:
carry flag set
Notes:
) The allocated block is guaranteed to have at least dword alignment.
) This function does not allocate any descriptors for the memory block. It is
the responsibility of the client to allocate and initialize any descriptors
needed to access the memory with additional function calls.
2.30 - Function 0502h - Free Memory Block:
------------------------------------------
Frees a memory block previously allocated with the Allocate Memory Block
function (0501h).
In:
AX = 0502h
SI:DI = memory block handle
Out:
if successful:
carry flag clear
if failed:
carry flag set
Notes:
) No descriptors are freed by this call. It is the client's responsibility to
free any descriptors that it previously allocated to map the memory block.
Descriptors should be freed before memory blocks.
2.31 - Function 0503h - Resize Memory Block:
--------------------------------------------
Changes the size of a memory block previously allocated with the Allocate
Memory Block function (0501h).
In:
AX = 0503h
BX:CX = new size of block in bytes (must be non-zero)
SI:DI = memory block handle
Out:
if successful:
carry flag clear
BX:CX = new linear address of memory block
SI:DI = new memory block handle
if failed:
carry flag set
Notes:
) After this function returns successfully, the previous handle for the memory
block is invalid and should not be used anymore.
) It is the client's responsibility to update any descriptors that map the
memory block with the new linear address after resizing the block.
2.32 - Function 0800h - Physical Address Mapping:
-------------------------------------------------
Converts a physical address into a linear address. This functions allows the
client to access devices mapped at a specific physical memory address.
Examples of this are the frame buffers of certain video cards in extended
memory.
In:
AX = 0800h
BX:CX = physical address of memory
SI:DI = size of region to map in bytes
Out:
if successful:
carry flag clear
BX:CX = linear address that can be used to access the physical memory
if failed:
carry flag set
Notes:
) It is the caller's responsibility to allocate and initialize a descriptor
for access to the memory.
) Clients should not use this function to access memory below the 1 MB
boundary.
2.33 - Function 0801h - Free Physical Address Mapping:
------------------------------------------------------
Releases a mapping of physical to linear addresses that was previously
obtained with function 0800h.
In:
AX = 0801h
BX:CX = linear address returned by physical address mapping call
Out:
if successful:
carry flag clear
if failed:
carry flag set
Notes:
) The client should call this function when it is finished using a device
previously mapped to linear addresses with function 0801h.
2.34 - Function 0900h - Get and Disable Virtual Interrupt State:
----------------------------------------------------------------
Disables the virtual interrupt flag and returns the previous state of it.
In:
AX = 0900h
Out:
always successful:
carry flag clear
AL = 0 if virtual interrupts were previously disabled
AL = 1 if virtual interrupts were previously enabled
Notes:
) AH is not changed by this function. Therefore the previous state can be
restored by simply executing another INT 31h.
) A client that does not need to know the prior interrupt state can execute
the CLI instruction rather than calling this function. The instruction may
be trapped by a DPMI host and should be assumed to be very slow.
2.35 - Function 0901h - Get and Enable Virtual Interrupt State:
---------------------------------------------------------------
Enables the virtual interrupt flag and returns the previous state of it.
In:
AX = 0901h
Out:
always successful:
carry flag clear
AL = 0 if virtual interrupts were previously disabled
AL = 1 if virtual interrupts were previously enabled
Notes:
) AH is not changed by this function. Therefore the previous state can be
retstored by simply executing another INT 31h.
) A client that does not need to know the prior interrupt state can execute
the STI instruction rather than calling this function. The instruction may
be trapped by a DPMI host and should be assumed to be very slow.
2.36 - Function 0902h - Get Virtual Interrupt State:
----------------------------------------------------
Returns the current state of the virtual interrupt flag.
In:
AX = 0902h
Out:
always successful:
carry flag clear
AL = 0 if virtual interrupts are disabled
AL = 1 if virtual interrupts are enabled
Notes:
) This function should be used in preference to the PUSHF instruction to
examine the interrupt flag, because the PUSHF instruction returns the
physical interrupt flag rather than the virtualized interrupt flag. On some
DPMI hosts, the physical interrupt flag will always be enabled, even when
the hardware interrupts are not being passed through to the client.
2.37 - Function EEFFh - Get DOS Extender Information:
-----------------------------------------------------
Returns information about the DOS extender.
In:
AX = EEFFh
Out:
if successful:
carry flag clear
EAX = 'PMDW' (504D4457h)
ES:EBX = selector:offset of ASCIIZ copyright string
CH = protected mode system type (0=raw, 1=XMS, 2=VCPI, 3=DPMI)
CL = processor type (3=386, 4=486, 5=586)
DH = extender MAJOR version (binary)
DL = extender MINOR version (binary)
if failed:
carry flag set
Notes:
) In PMODE/W's implementation of this function, the value returned in ES is
equivalent to the 4G data selector returned in DS at startup.
) This function is always successful under PMODE/W.
------------------------------------------------------------------------------
-------------- 3 - Supported DOS extended INT 21h functions ------------------
------------------------------------------------------------------------------
For the most part, PMODE/W extends only the most widely used DOS functions.
The term "extend" means to extend real mode 16:16 pointers which have a limit
of 1MB into the full protected mode range of 16:32 pointers with a range of
4GB. Since DOS can only address memory under 1MB, we must buffer any data that
is to be passed to or from DOS in low memory. Only DOS functions which use
16:16 pointers or segment registers need to be extended. This means that DOS
functions that are not listed here can still be used provided they don't make
use of those kinds of parameters. Examples of such functions are INT 21h
AH=30h or INT 21h AH=2, etc. The following is a detailed list of all functions
extended by PMODE/W. All segment registers used as parameters must be valid
protected mode selectors. Any functions that are not listed here will be
passed on to the real mode INT 21h handler without any buffering or
modification. This and the other sections on interrupts are provided as
reference as to how PMODE/W deals with these interrupts. It is assumed the
reader is familiar with the normal real mode operation of these functions.
3.0 - Function 09h - Write String to Standard Output:
-----------------------------------------------------
In:
AH = 09h
DS:EDX -> '$' terminated string to write
Out:
always successful
3.1 - Function 1Ah - Set Disk Transfer Area:
--------------------------------------------
In:
AH = 1Ah
DS:EDX -> buffer for DTA
Out:
always successful
Notes:
) PMODE/W keeps an internal DTA buffer in low memory that is used to buffer
any functions which use the DTA. After calling the real mode DOS function,
the data will be transfered into the buffer specified by DS:EDX.
3.2 - Function 1Bh - Get Allocation Information for Default Drive:
------------------------------------------------------------------
In:
AH = 1Bh
Out:
always successful:
AL = sectors per cluster
ECX = bytes per sector
EDX = total number of clusters
DS:EBX -> media ID byte
Notes:
) This functions simply converts the real mode segment:offset returned by DOS
to a protected mode selector:offset.
3.3 - Function 1Ch - Get Allocation Information for Specific Drive:
-------------------------------------------------------------------
In:
AH = 1Ch
DL = drive number
Out:
if successful:
AL = sectors per cluster
ECX = bytes per sector
EDX = total number of clusters
DS:EBX -> media ID byte
if failed:
AL = FFh (invalid drive)
Notes:
) This functions simply converts the real mode segment:offset returned by DOS
to a protected mode selector:offset.
3.4 - Function 1Fh - Get Drive Parameter Block for Default Drive:
-----------------------------------------------------------------
In:
AH = 1Fh
Out:
if successful:
AL = 0
DS:EBX -> drive parameter block
if failed:
AL = FFh (invalid drive)
Notes:
) This functions simply converts the real mode segment:offset returned by DOS
to a protected mode selector:offset.
3.5 - Function 25h - Set Interrupt Vector:
------------------------------------------
In:
AH = 25h
AL = interrupt number
DS:EDX -> interrupt routine
Out:
if successful:
carry flag clear
if failed:
carry flag set
Notes:
) This function is equivalent to INT 31h function 0205h.
3.6 - Function 2Fh - Get Disk Transfer Area:
--------------------------------------------
In:
AH = 2Fh
Out:
al
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?