156
K
A
DAK
Advanced Topics
A Task Termination Procedure can be coded in assembler as a FAR procedure as indicated
in the following example. The procedure receives an integer reason code indic ating
whether the task is being stopped, killed or deleted. The mnemonics for these reason
codes are provided in the AMX header file AMX831SD.DEF.
Upon entry to the procedure, the following conditions exist:
Interrupts are enabled.
All registers are free for use.
AX Reason code indicating stop, kill or delete task (AMCFx)
DS,ES DGROUP segment
SS:SP Task stack in effect at the time of the termination request
The direction flag is set to forward.
INCLUDE AMX831SD.DEF ;AMX Definitions
;
;
USER_CODE SEGMENT BYTE 'CODE'
;ASSUME CS:USER_CODE
;
TERMPROC PROC FAR ;Task Termination Procedure
:
AX = AMCFE if stop task is occurring
AX = AMCFK if kill task is occurring
AX = AMCFD if delete task is occurring
:
RET
;
TERMPROC ENDP
;
USER_CODE ENDS