360
K
A
DAK
Generator Specifications
Macro parameters appear in the macro body as parameter identifiers. A parameter
identifier is a decimal integer preceded and followed by the delimiter character defined in
the macro definition statement (~1~, ~2~, etc.). The number identifies the parameter in
the particular parameter list specified by the parameter keyword. The parameter is copied
from the User Parameter File into the source language macro body replacing the
particular identifier. The parameters are numbered 1 to n from left to right in the
parameter list following the keyword in the User Parameter File.
A second form of macro parameter has the letter P preceding the number in the parameter
identifier, as in the IF statement in the example. This form directs the Configuration
Generator to replace the parameter identifier with the character 1 if the identified
parameter is present in the parameter list. If the parameter is missing from the parameter
list, the Configuration Generator replaces the parameter identifier with the character 0.
In the above example the macro requires the first and third parameter values from a line
in the User Parameter File containing the keyword ...TMR. If the third parameter is
missing from the keyword parameter list in the User Parameter File, the IF statement will
be false, inhibiting the assembler directive EXTRN which, without valid arguments, would
produce an assembler error.
The macro is terminated by the macro end directive containing the macro keyword
...ENDM.
When the Configuration Generator encounters a macro definition in the System
Configuration Template File, it scans the User Parameter File for a matching parameter
keyword. The macro body is expanded and copied into the System Configuration
Module File once for each matching parameter keyword located in the User Parameter
File.
A third type of directive is used to define an incremental integer variable. An
incremental variable is defined with an initial value and an increment which is added to
the variable each time a macro containing the variable is expanded by the Configuration
Generator. Note that this ;~...VAR directive begins with the assembler comment
character and the parameter delimiter character required by all KADAK macro directives.
The variable name is a string of printable characters preceded and followed by one or
more space and/or tab characters. Although only one incremental variable is allowed, its
name, initial value and increment can be redefined and used with other macros.
The example below illustrates the use of an incremental variable.
;~...VAR &TN 1,1 ;start at task 1
;~...MAC ...TDT PROC,TAG,ATTR,STACK,PR,SLICE,MB0,MB1,MB2,MB3,TKID
;DD (~4~+3)/4 DUP(?)
@L@K&TN LABEL WORD ;Initial stack pointer
; ;for task &TN (tag ~2~)
;~...ENDM