18.08.2013 Views

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Words 27–39<br />

May also be used for source output, that is, with SOR.<br />

Words 29–38<br />

Contain the relocatable element table item.<br />

14.1.4. Reusable Processor Construction<br />

PREPRM, PREPRO, PREPF$, and POSTPR$<br />

Initial program load operations are expensive relative to swapping. A mechanism is<br />

provided that allows a program to make itself reusable, thereby avoiding the need to<br />

reload itself. This applies to programs called by processor call statements but not by<br />

@XQT. If the processor in question makes use of the standard processor interface<br />

routines (PREPRO, PREPRM, POSTPR$, ROR, SOR, SIR$), implementing reusability is<br />

not a major task. The following describes the appropriate steps.<br />

1. Register the processor name with INFOR CLIST (ER CLIST$), either ASCII or<br />

Fieldata. Use a type 0 list, because an unknown control statement terminates CLIST<br />

mode. See the Exec ER <strong>Programming</strong> <strong>Reference</strong> <strong>Manual</strong>.<br />

2. Become self-initializing or self-reinitializing. This means that any data areas that are<br />

expected to contain particular values at the beginning of the program must be<br />

initialized by a particular instruction sequence. Do not rely on static data initialization.<br />

Do this by explicitly setting all initialized variables to their initial value or by reloading<br />

the main segment. The former method is recommended unless the number of<br />

variables is excessive.<br />

3. Check for potential reusability as indicated in PARTBL by SIR$ (S4 of PARTBL+13;<br />

see Figure 14–1); then call REPRO$ or REPRM$ to read the next INFOR, if any;<br />

reinitialize or terminate depending on which return is given by REPRO$/REPRM$.<br />

This is done with the following steps:<br />

a. If S4 of PARTBL+13 > 0, call POSTPR$, then quit.<br />

b. Zero INFOR$ (see Section 12), then call REPRO$ or REPRM$, setting A0 as<br />

desired.<br />

c. If absolute-eof return, call POSTPR$, then quit.<br />

d. If wrong CLIST value, take action as defined for the particular processor in<br />

question.<br />

e. If error return, treat same as error return from PREPRO or PREPRM.<br />

f. If normal return, reinitialize the processor (and SIR$, if used, by storing 0 in<br />

SIRP2$); begin new processing operation (compilation, assembly, and so on).<br />

7833 1733–004 14–7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!