236
K
A
DAK
AMX 86 Procedures
ajgmsg ajgmsg
Purpose Get Message from Task Mailbox
Used by n Task o IS P o Timer Procedure o Restart Procedure n Exit Procedure
Setup int priority;
char msg[AMXMSZ];
int status;
.
.
status = ajgmsg(priority, msg);
AX CX ES:BX
Where priority is the priority of the task mailbox from which the message is to
be fetched.
(0 = highest; 3 = lowest)
(4 = highest priority available message)
msg is an array name or pointer to AMXMSZ consecutive bytes of storage
into which the message will be copied if it is available. The message
storage variable may be any AMXMSZ byte structure. AMXMSZ is
configured in the User Parameter File.
Results Interrupts are disabled and then restored to their state at the time of the
call.
Status is returned.
AEROK = Call successful
AERCWT = Task's caller is still waiting
AERNMG = No message waiting in the specified task mailbox
If status is not AEROK, the variable msg is unaltered.
If you get status AERCWT, the task which is making the ajgmsg call is
currently processing a message sent from a task which is waiting for
acknowledgement that its message has been received. You cannot get a
new message until you finish with the current one. Call ajwakc to wake
the waiting task and then call ajgmsg again.
See Also ajsend, ajsenw, ajwakc