Intermec 6100 Reference Guide

Page of 328
SECTION 6
Conversions and Interfaces
6-68    PEN*KEY
R
 6100 Computer Programmer’s Reference Guide
System Services: Interrupt 15h
INT 15h, Function AX = 0100h:  Create a Task
4000API
Creates a task and inserts the new task into the ready list.
On Entry:
AH = 01h
AL = 00h
ES:BX = Context pointer
On Return:
CX = New task identifier
The context pointer (ES:BX) points at a structure that looks like the following
Code Fragment:
context struc
dival
dw   ?   ;di register contents for new task
sival
dw   ?   ;si register contents for new task
bpval
dw   ?   ;bp register contents for new task
dw   ?   ;does not care
bxval
dw   ?   ;bx register contents for new task
dxval
dw   ?   ;dx register contents for new task
cxval
dw   ?   ;cx register contents for new task
dw   ?   ;does not care
esval
dw   ?   ;es register contents for new task
dsval
dw   ?   ;ds register contents for new task
ipval
dw   ?   ;ip register contents for new task
csval
dw   ?   ;cs register contents for new task
dw   ?   ;does not care
context ends
csval:ipval specifies the code segment and instruction pointer where the
child task begins execution; the parent task MUST provide them.  The child
task always inherits the flags register from the parent.
Create returns a task ID that is computed with the following equation (ES:BX is
the value passed to the create task function):
Task_id = ((es << 4) + bx) >> 4;
When a newly created task is activated, SS (stack segment) is set to the passed
value of ES (extra segment); SP (stack pointer) is set to the passed value of BX.
The task context is then popped off the stack into the processor registers and an
IRET is executed to pass control to the task.  Thus, the new tasks SS:SP point at
the base" of the context passed during the create command.
INT 15h, Function AX = 0101h:  Delete a Task
4000API
On Entry:
AH = 01h
AL = 01h
CX = Task identifier (0 means delete current task)
On Return:
CX = Task identifier (0 if task not found)
ES:BX = Released TCB address
6. Conversions and
Interfaces