PROC Assembler Statement
name PROC 〚type〛 USING regbank
name PROC TASK 〚taskname〛 〚INTNO 〚intname〛〚= intno〛〛
name PROC INTERRUPT intname = intno USING regbank
The PROC statement defines a procedure.
||specifies the name of the procedure.
||specifies that the procedure is a standard procedure
||specifies that the procedure is near or far. If no
type is specified, the assembler assumes near regardless
of the selected CPU mode (segmented or non-segmented). The
assembler uses the procedure type to automatically generate the
appropriate CALL and RET instructions.
||specifies that the procedure is a TGROUP task procedure. A
TGROUP task is a unit with one or more modules. The entry point
to the task is the task procedure and the exit point from the
task is a RETI instruction contained in the task
procedure. A task is a unit that performs a certain function. It
is activated by a software or hardware trap that causes an
interrupt and that branches to the task procedure using an entry
in the interrupt vector table.
||specifies the TGROUP for the task procedure. If no
taskname is specified, an unnamed task procedure is
created. The taskname must be unique and, if specified,
intname and its value are GLOBAL symbols.
||specifies a unique symbolic name for the interrupt vector of
the task procedure or interrupt procedure. If the intname
is not assigned an intno, the interrupt or vector number
is relocatable and may be supplied by the linker.
For task procedures, the symbolic trap number activates tasks
through a trap instruction which has a trap number as its
operand. The trap name is known automatically system-wide.
||specifies a numeric expression that evaluates to a constant
value from 0-127 which represents the interrupt number of the
interrupt procedure. The intno is assigned to
intname (if specified).
||specifies that the procedure is an interrupt service
||specifies the register bank that the procedure uses.
||specifies the name of a register bank that has been
previously defined with the REGBANK directive.
Procedures must include a RET instruction which the
assembler converts into one of the following machine return
- RETS: Return from far procedure.
- RETI: Return from interrupt procedure.
- RET: Return from near procedure.
Procedures defined with the PROC statement must be
terminated by the ENDP statement.
Unlike procedures and functions created in high-level languages
(like C and C++), identifier scope in assembly language is
module-wide. For this reason, identifiers used in assembly
procedures must be unique.
Procedures defined with the PROC statement may be called
from within the same code segment (a near call) or may be called
from a different code segment (a far call). They may be created as
either near or far procedures (specified by the type).
The assembler does not verify whether or not a return
instruction was used in a procedure. This is the responsibility of
Related Knowledgebase Articles