📄 ref.gml
字号:
Use this function to release selectors allocated by
GetSel or AliasSel.
.endnote
.*
.mbox begin
:api.ResMem:eapi. :dsc.Resize a previously allocated block of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff0dh
.br
BX= Selector for block.
.br
CX:DX= New size of block required in bytes.
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector is passed in BX or not enough
memory is available when increasing the block size, then this function
returns carry set.
.note Notes:
If the memory block cannot be resized in its current
location, but a free block of memory of the new size exists, the memory
is copied to a new block and the old one is released. The application
is not affected as long as only the selector originally allocated with
GetMem accesses the memory.
.endnote
.*
.mbox begin
:api.ResMemSO:eapi. :dsc.Resize a block of memory allocated via GetMemSO.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff2dh
.br
SI:DI = Selector:offset of block to resize
.br
CX:DX = New size of block required in bytes
.note Outputs:
Carry set on error, else
.br
SI:DI = selector:offset of new memory block address.
.note Errors:
If an invalid selector:offset is passed in SI:DI or
not enough memory is available when increasing the block size, then this
function returns carry set.
.note Notes:
If the memory block cannot be resized in its current
location, but a free block of memory of the new size exists, the memory
is copied to a new block and the old one is released. The
selector:offset will change if this occurs, so the SI:DI return value
should be used to update all references and pointers to the memory block
when this function is called.
.endnote
.*
.mbox begin
:api.ResMem32:eapi. :dsc.Resize a previously allocated block of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff0eh
.br
BX= Selector for block.
.br
ECX= New size of block required in bytes.
.note Outputs:
Carry set on error.
.note Errors:
See ResMem
.note Notes:
If the memory block cannot be resized in its current
location, but a free block of memory of the new size exists, the memory
is copied to a new block and the old one released. This is transparent
to the application as long as only the selector originally allocated
with GetMem is used to access the memory.
.endnote
.*
.mbox begin
:api.ResMemDOS:eapi. :dsc.Resize a block of DOS (conventional) memory allocated with GetMemDOS.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff22h
.br
BX= New block size in paragraphs
.br
DX= Selector of block to modify
.note Outputs:
Carry set on error, AX= DOS error code, BX= Maximum
block size in paragraphs.
.note Errors:
If an invalid block is passed or if not enough
selectors or memory are available when expanding the block this function
returns carry set.
.note Notes:
Growing a memory block is often likely to fail since
other DOS block allocations prevent increasing the size of the block.
Also, if the size of a block grows past a 64KB boundary then the
allocation fails if the next descriptor in the LDT is not free.
.endnote
.*
.mbox begin
:api.ResMemLinear:eapi. :dsc.Resize a previously allocated block of memory without a selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff12h
.br
SI:DI= Linear address of block to resize.
.br
CX:DX= Size of block required in bytes.
.note Outputs:
Carry set on error, else
.br
SI:DI= New linear address of block.
.note Errors:
If not enough memory is available when extending the
block size this function returns carry set.
.note Notes:
If the memory block cannot be expanded to the desired
size, and a free block of sufficient size exists, the existing memory is
copied to the free block and released. The new block is allocated in
place of the old.
.endnote
.*
.mbox begin
:api.ResMemLinear32:eapi. :dsc.Resize a previously allocated block of memory without a selector.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff13h
.br
ESI= Linear address of block to resize.
.br
ECX= Size of block required in bytes.
.note Outputs:
Carry set on error else,
.br
ESI= New linear address of block.
.note Errors:
See ResMemLinear
.note Notes:
If the memory block cannot be expanded to the desired
size, and a free block of sufficient size exists, the existing memory is
copied to the free block and released. The new block is allocated in
place of the old.
.endnote
.*
.mbox begin
:api.SetDOSTrans:eapi. :dsc.Set new address and size of the buffer used for DOS memory transfers.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff26h
.br
BX = Real mode segment of buffer.
.br
DX = Protected mode selector for buffer.
.br
ECX = Buffer size (should be <=64KB)
.note Outputs:
None
.note Errors:
None
.note Notes:
The buffer must be in conventional memory and only the
first 64KB will be used even if a bigger buffer is specified. CauseWay
will automatically restore the previous buffer setting when the
application terminates but GetDOSTrans can be used to get the current
buffer's settings if you only want the change to be temporary.
.np
You can still use the default buffer for your own
purposes even after setting a new address.
.endnote
.*
.mbox begin
:api.SetDump:eapi. :dsc.Disable/enable error display and CW.ERR creation.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff30h
.br
CL = 0 if disable error display and CW.ERR file
.br
CL = nonzero if enable error display and CW.ERR file
.note Outputs:
None
.note Errors:
None
.note Notes:
By default, register dump display to screen and CW.ERR
file creation are enabled on CPU faults. This option may be used to
turn on and off CauseWay error processing output any number of times
within an application.
.endnote
.*
.mbox begin
:api.SetEVect:eapi. :dsc.Set Protected mode exception handler address.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0203h
.br
BL= Exception vector number.
.br
CX:[E]DX= selector:offset of new handler.
.note Outputs:
None
.note Errors:
The number in BL must be in the range 0-1Fh. Anything
outside this range returns carry set.
.endnote
.*
.mbox begin
:api.SetMCBMax:eapi. :dsc.Set new memory control block (MCB) memory allocation block size.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff28h
.br
ECX = New value to set (<=64KB)
.note Outputs:
None
.note Errors:
Carry set on error
.note Notes:
The maximum block size that will be allocated from MCB
memory is 16 bytes less than the value set by this function. The default
value is 16384. The maximum value is 65536.
.np
The CauseWay API memory allocation functions
allocate memory from two sources. Allocation requests below the value
returned by this function are allocated from a memory pool controlled
via conventional style MCB's. Requests above this value are allocated
via the normal DPMI functions. Because DPMI memory is always allocated
in multiples of pages (4KB) it can become very inefficient for any program
that needs to allocate small blocks of memory. The value set by this function
controls the size of memory chunks that will be allocated to and managed
by the MCB system.
.np
A value of zero can be passed to this function to
disable the MCB allocation system.
.np
The value passed will be rounded up to the
nearest page (4KB) boundary.
.endnote
.*
.mbox begin
:api.SetRVect:eapi. :dsc.Set real mode interrupt handler address.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0201h
.br
BL= Interrupt vector number.
.br
CX:DX= selector:offset of new handler.
.note Outputs:
None.
.note Errors:
None.
.endnote
.*
.mbox begin
:api.SetSelDet:eapi. :dsc.Set selector linear base and limit.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff09h
.br
BX= Selector.
.br
CX:DX= Linear base.
.br
SI:DI= Byte granular limit.
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector is passed in BX, this function
returns with carry set.
.endnote
.*
.mbox begin
:api.SetSelDet32:eapi. :dsc.Set selector linear base and limit.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff0ah
.br
BX= Selector.
.br
EDX= Linear base.
.br
ECX= Byte granular limit.
.note Outputs:
Carry set on error.
.note Errors:
If an invalid selector is passed in BX, this function
returns with carry set.
.endnote
.*
.mbox begin
:api.SetVect:eapi. :dsc.Set Protected mode interrupt handler address.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0205h
.br
BL= Interrupt vector number.
.br
CX:[E]DX= selector:offset of new handler.
.note Outputs:
None.
.note Errors:
None.
.endnote
.*
.mbox begin
:api.UnLockMem:eapi. :dsc.Unlock a region of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff1dh
.br
BX:CX= Starting linear address of memory to unlock
.br
SI:DI= Size of region to unlock in bytes
.note Outputs:
Carry set on error.
.note Errors:
If any of the memory region specified is invalid this
function returns carry set.
.note Notes:
This function allows the unlocked memory to be swapped
to disk by the VMM if necessary. Areas below and above the specified
memory to the nearest page (4KB) boundary are unlocked if the specified region
is not aligned to a page boundary.
.endnote
.*
.mbox begin
:api.UnLockMem32:eapi. :dsc.Unlock a region of memory.:edsc.
.mbox end
.begnote
.note Inputs:
AX= 0ff1eh
.br
ESI= Starting linear address of memory to unlock
.br
ECX= Size of region to unlock in bytes
.note Outputs:
Carry set on error.
.note Errors:
See UnLockMem
.note Notes:
This function allows the memory to be swapped to disk
by the VMM if necessary. Areas below and above the specified memory to
the nearest page (4KB) boundary are unlocked if the specified region is not
aligned to a page boundary.
.endnote
.*
.mbox begin
:api.UserDump:eapi. :dsc.Setup user-defined error buffer dump in CW.ERR.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff2fh
.br
ES:[E]DI - user buffer to display in CW.ERR
.br
CX = count of bytes to display from buffer in CW.ERR
.br
BL = 'A' if ASCII dump (non-binary display of bytes,
control characters display as periods)
.br
BH = nonzero if preset ASCII buffer to word value,
ignored for non-ASCII
.br
DX = word value to fill ASCII dump buffer if BH is
nonzero, ignored for non-ASCII
.note Outputs:
Carry set on ASCII dump invalid buffer address.
.note Errors:
The user buffer must be a valid readable selector and
offset value when this function is called or else the request is ignored
and a carry flag condition is returned. If BH is set to nonzero to flag
presetting the buffer bytes, the selector must be writable. Specifying
a larger CX count than available buffer size will also return an error.
.note Notes:
If the fill ASCII buffer condition is specified, any
values previously in the buffer will be overwritten when this call is made.
.endnote
.*
.mbox begin
:api.UserErrTerm:eapi. :dsc.Call user error termination routine.:edsc.
.mbox end
.begnote
.note Inputs:
AX = 0ff31h
.br
CL = 0 if 16-bit termination routine
.br
CL = nonzero if 32-bit termination routine
.br
DS:[E]SI = user termination routine address.
If DS is zero, the user termination routine
call is removed.
.br
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -