User`s manual
n710p68k (n710p80k)
SBCSCSI/D1 4-5
4
The script_ptr[] array contains pointers to the starting location of each
SCRIPTS declared with a PROC n710c68k (n710c80k) compiler directive. Array
indexes used to access script_ptr[] array elements are global integer
variables generated by the preprocessor and placed in the output file file.i. The
variable name of an array index is formed from the name of the SCRIPTS
array, with the suffix "_idx" appended. The steps in the example below
illustrate how to reference a SCRIPTS pointer for the SCRIPTS array selected.
1. Declare the external script_ptr[] array:
Example: extern unsigned script_ptr[];
2. Declare the external array index names:
Example: extern unsigned selected_idx;
3. Reference the
script_ptr[] entry for selected:
Example: script_addr = script_ptr[selected_idx];
RETURN VALUE
If n710p68k (n710p80k) is successful, then 0 is returned. If n710p68k (n710p80k)
is not successful, then a nonzero value is returned and an error message is
printed to stderr.
NOTES
All variables referenced by the SCRIPTS must be contained in a single global
data structure. Furthermore, all references within SCRIPTS instructions to
these variables must be made with the following syntax:
PASS(NCROF(
variable
))
where the length of the string name for variable cannot exceed 25 characters.
The C macro NCROF is defined as:
#define NCROF(
variable
) (UINT) &((struct siopdata *) 0)->
variable
Here siopdata is the name of the global data structure containing all
relocatable data references. An example SCRIPTS source level instruction
referencing a relocatable variable is:
move memory 1, PASS(NCROF(nopmsg)), PASS(NCROF(q_taginflg))
If the C preprocessor cpp is run prior to the execution of n710p68k (n710p80k),
then it is necessary to prevent the NCROF macro from being expanded until after
n710p68k (n710p80k) has executed.