GetMem32 Allocate a block of memory.

Inputs: AX = 0ff0ch

ECX = Size of block required in bytes. (-1 to get maximum memory size)

Outputs: Carry set on error else,

BX = Selector to access the block with or if ECX was -1,

ECX = size of largest block available.

Errors: See GetMem

Notes: This function allocates a block of extended (application) memory and allocates a selector with a suitable base and limit.

GetMemDOS Allocate a region of DOS (conventional) memory.

Inputs: AX = 0ff21h

BX = Number of paragraphs (16 byte blocks) required.

Outputs: Carry set on error and BX = largest block size,

AX =DOS error else,

AX = Initial real mode segment of allocated block

DX = Initial selector for allocated block

Errors: If there are not enough selectors or memory available then this function returns carry set.

Notes: If the size of the block requested is greater than 64K 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 64K except for the final descriptor which has a limit of block size MOD 64K. For 16-bit applications, always set the limit of the first descriptor to 64K.

Next Page

Previous Page

Go to Table of Contents