📄 ref.gml
字号:
.endnote
.*
.mbox begin
:api.GetMemDOS:eapi. :dsc.Allocate a region of DOS (conventional) memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff21h
.br
BX= Number of paragraphs (16 byte blocks) required.
.note Outputs:
Carry set on error and BX= largest block size,
.br
AX=DOS error, else
.br
AX= Initial real mode segment of allocated block
.br
DX= Initial selector for allocated block
.note Errors:
If there are not enough selectors or memory available
then this function returns carry set.
.note Notes:
If the size of the block requested is greater than 64KB
bytes (BX >1000h) then contiguous descriptors are allocated. If more
than one descriptor is allowed under 32-bit applications, the limit of
the first descriptor is set to the size of the entire block. All
subsequent descriptors have a limit of 64KB except for the final
descriptor which has a limit of block size modulo 64KB. For 16-bit
applications, always set the limit of the first descriptor to 64KB.
.endnote
.*
.mbox begin
:api.GetMemLinear:eapi. :dsc.Allocate a block of memory without a selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff10h
.br
CX:DX= Size of block required in bytes.
.note Outputs:
Carry set on error, else
.br
SI:DI= Linear address of block allocated.
.note Errors:
If not enough memory is available to satisfy the
request then this function returns carry set.
.note Notes:
Addresses returned by this function may be above 16MB.
.endnote
.*
.mbox begin
:api.GetMemLinear32:eapi. :dsc.Allocate a block of memory without a selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff11h
.br
ECX= Size of block required in bytes.
.note Outputs:
Carry set on error, else
.br
ESI= Linear address of block allocated.
.note Errors:
See GetMemLinear
.note Notes:
Addresses returned by this function may be above 16MB.
.endnote
.*
.mbox begin
:api.GetMemSO:eapi. :dsc.Allocate a block of memory with selector:offset.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff2ch
.br
CX:DX = Size of block required in bytes
.note Outputs:
Carry set on error, else
.br
SI:DI = selector:offset of allocated memory
.note Errors:
See GetMem
.note Notes:
This function allocates a block of memory with an
associated selector:offset. The allocation does not consume a selector
on each call as does GetMem because a non-zero offset from an existing
selector for this allocation type is returned. GetMemSO is useful for
applications which make a large number of allocations where running out
of selectors with GetMem could be a problem. A potential drawback is
that memory accesses beyond the allocation boundary may go undetected
since the selector is shared among several allocations. Also, resizing
the block can change the selector:offset of the block.
.endnote
.*
.mbox begin
:api.GetRVect:eapi. :dsc.Get real mode interrupt handler address.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0200h
.br
BL= Interrupt vector number.
.note Outputs:
CX:DX= selector:offset of handler.
.note Errors:
None.
.endnote
.*
.mbox begin
:api.GetSel:eapi. :dsc.Allocate a new selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff03h
.note Outputs:
Carry set on error, else
.br
BX= Selector.
.note Errors:
Approximately 8192 selectors are available initially.
While this is a relatively large quantity, it is obviously possible
to run out if the system is heavily loaded or selectors are being wasted.
.note Notes:
A selector is allocated and initialized with a base of
0, a limit of 0 and as read/write expand up data. Use SetSelDet to make
the selector useful, setting an appropriate base and limit.
.endnote
.*
.mbox begin
:api.GetSelDet:eapi. :dsc.Get selector linear base and limit.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff07h
.br
BX= Selector
.note Outputs:
Carry set on error, else
.br
CX:DX= Linear base.
.br
SI:DI= Byte granular limit.
.note Errors:
If an invalid selector is passed in BX, this function
returns with carry set.
.endnote
.*
.mbox begin
:api.GetSelDet32:eapi. :dsc.Get selector linear base and limit.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff08h
.br
BX= Selector
.note Outputs:
Carry set on error, else
.br
EDX= Linear base.
.br
ECX= Byte granular limit.
.note Errors:
If an invalid selector is passed in BX, this function
returns with carry set.
.endnote
.*
.mbox begin
:api.GetVect:eapi. :dsc.Get Protected mode interrupt handler address.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0204h
.br
BL= Interrupt vector number.
.note Outputs:
CX:[E]DX= selector:offset of handler.
.note Errors:
None.
.endnote
.*
.mbox begin
:api.Info:eapi. :dsc.Get system selectors/flags.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff00h
.note Outputs:
AX= Selector for real mode segment address of 00000h, 4GB limit.
.br
BX= Selector for current PSP segment. 100h limit.
.br
[E]CX= DOS transfer buffer size. Always <64KB.
.br
DX= DOS transfer buffer real mode segment address.
.br
ES:[E]SI= DOS transfer buffer address.
.br
ESI+ECX always <64KB
.br
EDI= System flags. Bits significant if set.
.br
0 - 32 bit code default.
.br
1 - Virtual memory manager functional.
.br
2-3 - Mode, 0 - raw, 1 - VCPI, 2 - DPMI.
.br
4 - DPMI available.
.br
5 - VCPI available.
.br
6 - No memory managers.
.br
7 - Descriptor table type. 0 - GDT, 1 - LDT.
.note Errors:
None
.note Notes:
Bits 1-2 of DI indicate the interface type being used
by CauseWay.
.np
Bits 4-5 indicate the interface types that are
available. Bit 7 indicates the descriptor table being used to allocate
selectors to the application when on a raw/VCPI system. The DOS
transfer buffer is the area CauseWay uses to transfer data between
conventional and extended memory during DOS interrupts. This memory can
be used as temporary work space to access real mode code as long as you
remember it may be overwritten the next time you issue an INT in
protected mode that requires segment pointers.
.endnote
.*
.mbox begin
:api.IntXX:eapi. :dsc.Simulate real mode interrupt.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff01h
.br
BL= Interrupt number.
.br
ES:[E]DI= Real mode register list.
.note Outputs:
Register list updated.
.note Errors:
None.
.note Notes:
The real mode register list referenced by ES:[E]DI
should contain the register values you want passed to the real mode
interrupt handler. CauseWay fills in the SS:SP and Flags values to
ensure that legal values are used and the CS:IP entries are ignored.
This function bypasses protected mode interrupt handlers and provides
access to INT APIs that require segment pointers.
.endnote
.*
.mbox begin
:api.LockMem:eapi. :dsc.Lock a region of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff1bh
.br
BX:CX= Starting linear address of memory to lock.
.br
SI:DI= Size of region to lock in bytes.
.note Outputs:
Carry set on error.
.note Errors:
If any of the region specified is invalid or if not
enough physical memory is available to fill the region specified, then
none of the memory is locked and this function returns carry set.
.note Notes:
Memory that is locked cannot be swapped to disk by the
VMM. Locking applies to memory on page (4KB) boundaries. Therefore, areas of
memory below and above the memory being locked are locked if the
specified region is not aligned to a page boundary.
.endnote
.*
.mbox begin
:api.LockMem32:eapi. :dsc.Lock a region of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff1ch
.br
ESI= Starting linear address of memory to lock.
.br
ECX= Size of region to lock in bytes.
.note Outputs:
Carry set on error.
.note Errors:
See LockMem.
.note Notes:
Memory that is locked cannot be swapped to disk by the
VMM. Locking applies to memory on page (4KB) boundaries. Therefore, areas of
memory below and above the memory being locked are locked if the
specified region is not aligned to a page boundary.
.endnote
.*
.mbox begin
:api.RelCallBack:eapi. :dsc.Release a real mode call back entry.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0304h
.br
CX:DX= Real mode address returned by GetCallBack
.note Errors:
None.
.note Outputs:
None.
.note Notes:
Uspe this function to release call-back addresses once
they are no longer needed.
.endnote
.*
.mbox begin
:api.RelMem:eapi. :dsc.Release memory allocated by either GetMem or GetMem32.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff0fh
.br
BX= Selector for block to release.
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector is passed in BX or the memory
was not allocated via GetMem or GetMem32, this function returns carry set.
.endnote
.*
.mbox begin
:api.RelMemDOS:eapi. :dsc.Release a block of DOS (conventional) memory allocated by GetMemDOS.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff23h
.br
DX= Selector of block to free.
.note Outputs:
Carry set on error and AX= DOS error code.
.note Errors:
If an invalid block is passed, this function returns
carry set.
.note Notes:
All descriptors allocated for the memory block are
automatically freed and therefore should not be accessed once the block
is freed by this function.
.endnote
.*
.mbox begin
:api.RelMemLinear:eapi. :dsc.Release previously allocated block of memory (linear address).:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff14h
.br
SI:DI= Linear address of block to release.
.note Outputs:
Carry set on error.
.note Errors:
If the address passed in SI:DI is not a valid memory
block, this function returns carry set.
.endnote
.*
.mbox begin
:api.RelMemLinear32:eapi. :dsc.Release previously allocated block of memory (linear address).:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff15h
.br
ESI= Linear address of block to release.
.note Outputs:
Carry set on error.
.note Errors:
See RelMemLinear
.endnote
.*
.mbox begin
:api.RelMemSO:eapi. :dsc.Release a block of memory allocated via GetMemSO.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff2eh
.br
SI:DI = Selector:offset of block to release
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector:offset is passed in SI:DI or
the memory was not allocated via GetMemSO, then this function returns
carry set.
.endnote
.*
.mbox begin
:api.RelSel:eapi. :dsc.Release a selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff04h
.br
BX= Selector.
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector is passed in BX, this function
returns with carry set.
.note Notes:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -