Application Tasks
K
A
DAK
41
Message Extension
AMX delivers messages to a task by copying the message from a message envelope to a
message frame on the task's stack. AMX also presents an extension to the application
message on the task's stack. The message extension identifies who sent the message and,
if a task, whether the sender is waiting for a response.
The message extension is provided for the use of private AMX tasks such as the Kernel
Task. Application tasks should rarely be aware of its presence.
Access to the message extension is illustrated in the following C example. Refer to
Appendix D for a description of the message extension structure amxmsgxs. Assembler
programmers will find the message extension on the task stack at SS:BP+UMS where UMS
is the size of your application messages declared in your AMX User Parameter File.
#include "amx831sd.h" */ AMX Structure Definitions */
#define UMS 12 */ User message size */
void taskn(int dummy) */ Dummy parameter declaration */
{struct amxmsgxs *msgxp; /* Message extension pointer */
msgxp = (struct amxmsgs *)((char *)&dummy + UMS);
:
The message extension can now be accessed
using pointer msgxp.
:
}