-
Notifications
You must be signed in to change notification settings - Fork 3
Memory Functions
Joshua Riek edited this page Feb 17, 2020
·
1 revision
Get the inital low memory and allocate areas into the memory map
- IN:
Nothing
- OUT:
Nothing
Calculate how many blocks are required to allocate from the size in bytes
- IN:
AX:DX
= Size in bytes - OUT:
BX
= Blocks (1 block = 512 bytes)
Convert the block into a segment and offset address
- IN:
CX
= Block to get the address of - OUT:
ES:DI
= Pointer to the corresponding block
Convert the segment and offset address into a block
- IN:
ES:DI
= Pointer to memory address - OUT:
CX
= Block corresponding to the address
Allocate the next available block in memory
- IN:
Nothing
- OUT:
ES:DI, CF
= Pointer to memory address, Carry flag set on error
Allocate the next available blocks in memory
- IN:
BX
= Blocks to allocate (1 block is 512 bytes) - OUT:
ES:DI, CF
= Pointer to memory adress, Carry flag set on error
Allocate the next available bytes in memory
- IN:
AX:DX
= Size in bytes - OUT:
ES:DI, CF
= Pointer to memory address, Carry flag set on error
Free the block in memory related to the address
- IN:
ES:DI
= Pointer to memory address - OUT:
Nothing
Free the blocks in memory related to the address
- IN:
ES:DI, BX
= Pointer to memory address, Blocks to free (1 block is 512 bytes) - OUT:
Nothing
Free the bytes in memory related to the address
- IN:
ES:DI, AX:DX
= Pointer to memory address, size in bytes - OUT:
Nothing
Manually allocate an address into memory
- IN:
ES:DI, AX:DX
= Pointer to memory address, size in bytes - OUT:
CF
= Carry flag set on error