132
K
A
DAK
AMX Memory Manager
10.6 Memory Assignment Pro cedure
An application Memory Assignment Procedure must be provided to dynamically assign
memory sections to the Memory Manager. The Memory Assignment Procedure is called
by the Memory Manager when AMX is started, prior to execution of any of your Restart
Procedures.
The name of your Memory Assignment Procedure must be provided in your System
Configuration Module (see Chapter 14.5).
The Memory Assignment Procedure receives two pointers as parameters. The parameters
point to storage for the size of the memory section and for a pointer to the section. The
Memory Assignment Procedure must return the size of the memory section in bytes and a
pointer to the memory section in the storage provided. The procedure must also return a
non-zero integer if a valid memory section is provided. The minimum section size is 64
bytes which, in practical terms, provides no useable memory.
If the Memory Assignment Procedure cannot assign another memory section, it must
return an integer result of zero without modifying the storage provided for the memory
size.
Upon entry to the procedure, the pointers to storage for the memory size and memory
section pointer are present on the stack. Upon entry to the procedure, the following
conditions exist:
Interrupts reflect the state specified at the time AMX was
launched. If AMX was launched with launch parameter
AMLPIE, interrupts will be enabled. Otherwise interrupts will
be disabled.
All registers are free for use.
DS,ES DGROUP Segment
SS:SP AMX Kernel Stack ready for use
BP Offset of parameters on stack
The direction flag is set to forward.