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.

13.4. Examples<br />

MFDSP$–Master File Directory Service Package<br />

The following MASM instructions illustrate how the M$FDSP can be used:<br />

$INCLUDE ‘MAXR$/’<br />

$ASCII<br />

$(2)<br />

FNCT $EQU 0<br />

VALUE + 0<br />

BUFFER $RES 4400<br />

BUFFLN $EQU $-BUFFER<br />

$(1)<br />

START .<br />

DL A0,($CFS(‘MFD ‘))<br />

DS A0,BUFFER<br />

M$FDSP,‘CB’ BUFFLN,BUFFER,0<br />

J MFDERR<br />

M$FDSP,‘CB’ BUFFLN,BUFFER,FNCT<br />

J MFDERR<br />

LXI,U X11,0<br />

LXI,U A0,BUFFLN<br />

LXM,U A0,BUFFER<br />

M$FDSP ,, VALUE<br />

J MFDERR<br />

J DONE<br />

MFDERR .<br />

L$SNAP ‘MFDERR’,2,0,0<br />

DONE .<br />

ER EXIT$<br />

$END START<br />

The structure of the MFD is described in the Exec Administration <strong>Reference</strong> <strong>Manual</strong>.<br />

Every filename has a lead item entry in the MFD. For every F-cycle of that particular<br />

filename, a main item entry exists. The lead item contains links to all the main items,<br />

and it can be up to two sectors, sector 0 and sector 1. If there are more main items than<br />

sector 0 can hold links to, a sector 1 of the lead item will contain the links to the rest of<br />

the main items. To access all possible main items in the MFD, you must use the<br />

following algorithm:<br />

Call MFDSP$ specifying function 0 to initialize and get<br />

the first lead item.<br />

GETNEXTMAIN:<br />

Call MFDSP$ specifying function 4, (Get-Next-Main-Item),<br />

and continue calling Get-Next-Main-Item until a<br />

No-Find condition (A1=0) occurs.<br />

Call Get-Sector-1-of-Lead-Item (MFDSP$ function 3).<br />

IF a No-Find condition (A1=0) occurs, jump to GETNEXTLEAD.<br />

Call Get-Next-Main-Item and continue to call it until a<br />

No-Find condition occurs (A1=0).<br />

GETNEXTLEAD:<br />

Call Get-Next-Lead-Item (MFDSP$ function 2).<br />

IF a No-Find condition (A1=0) occurs, exit the program,<br />

OTHERWISE jump to GETNEXTMAIN.<br />

7833 1733–004 13–9

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

Saved successfully!

Ooh no, something went wrong!