204
K
A
DAK
AMX 86 Procedures
FAR pointers are passed to AMX as seg:reg as in the following example.
status = ajsenw(taskid, priority, (void FAR *)msg);
AX AASEND DX CX[14..0] ES:BX
CX[15]=1
Specific bits in a register reg are referenced using the syntax reg[bit] or
reg[highbit..lowbit]. In this example, CX[15] is bit 15 of register CX. CX[14..0] is
bits 0 to 14 inclusive of register CX. Unspecified bits in a register must be 0.
The above example also illustrates that procedure AASEND is the assembly language
counterpart of ajsenw, not AASENW as might otherwise be expected.
One final notational syntax is illustrated by the following example.
status = ajmxsndp(exchange, priority, parm1, parm2...);
AX AAMXSND BX DX @ES:SI
Procedure AAMXSND requires a FAR pointer to an AMX message in ES:SI. The message
is on the stack as parm1, parm2.... The syntax @seg:reg underneath a parameter
means that seg:reg will contain a FAR pointer to that parameter on the stack. In this
example, ES:SI will point to the copy of parm1 on the stack. Hence, procedure AAMXSND
will receive a FAR pointer to the AMX message parm1, parm2... in ES:SI as required.