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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SYSLIB</strong> Access Methods<br />

This type of switching between relocatable and common bank versions of a routine can<br />

be done as long as the calling program makes use of the I$BJ instruction instead of an<br />

LMJ or LIJ instruction to call the <strong>SYSLIB</strong> routines. For <strong>SYSLIB</strong> routines with a calling<br />

procedure, the field that determines the type of call to make to the routine must be set<br />

to 'CB' (common bank). If the field is set to 'A' (call the common bank version of the<br />

routine using the Auto Switch calling sequence) or left blank (a blank field means call the<br />

relocatable version of the routine), then the calling procedure generates an LMJ<br />

instruction. If an LMJ instruction or an LIJ instruction is generated to call the routine,<br />

then the program cannot switch between the common bank version and the relocatable<br />

version as described above.<br />

The I$BJ instruction is necessary because it remains undefined until the program is<br />

collected. At collection time, the I$BJ is resolved to an LMJ if the label being referenced<br />

resides in the same bank as the instruction referencing it, or it is resolved to an LIJ if the<br />

label is in another bank. Programs written before the implementation of the I$BJ routine<br />

may contain calling sequences such as the one that follows.<br />

LXI,U X11,PIRCB$<br />

LIJ X11,BASCFD$<br />

This sequence requires the calling program to know which common bank contains the<br />

routine as well as the name of the routine. Since the LIJ instruction is explicitly coded<br />

into this program, it always calls the common bank version of the <strong>SYSLIB</strong> ASCII to<br />

Fieldata routine. The program would have to be rewritten and reassembled to make it<br />

reference the relocatable version of the <strong>SYSLIB</strong> routine. A more flexible calling<br />

sequence is<br />

I$BJ X11,CBFDASC$<br />

The I$BJ procedure determines whether or not to generate a call to a common bank<br />

based on the label included on the call, in this case. If a common bank call is generated,<br />

the procedure handles retrieving the bank descriptor index of the common bank. Prior to<br />

executing the above calling sequence, the calling program must ensure that the correct<br />

values required by the <strong>SYSLIB</strong> routine have been loaded into the correct registers.<br />

For more information on common bank calls and the I$BJ routine, consult the Collector<br />

<strong>Programming</strong> <strong>Reference</strong> <strong>Manual</strong>.<br />

3–4 7833 1733–004

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

Saved successfully!

Ooh no, something went wrong!