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.

21.2.2.2. Write an Image<br />

SDFI, SDFO–System Data Format I/O Routines<br />

Each call to SDFO$ writes one image to the file or element. The calling program must<br />

supply the image and an ICW for the image. The calling program places the image in the<br />

image buffer and places the ICW in word 10 of the SDFO packet. SDFO combines the<br />

ICW and the image and places them in the I/O buffer to be written out.<br />

SDFO does not actually write an image to the file or element every time SDFO$ is called.<br />

SDFO places the images in the I/O buffer or buffers. When the buffer is filled or a call is<br />

made to SDFOC$ to close SDFO, the buffer is written out to the file or element.<br />

SDFO maintains the write address when writing to a file or element. The calling<br />

program only needs to specify the initial write address.<br />

Calling Sequence for SDFO$<br />

Auto Switch Common Bank or<br />

Relocatable<br />

L,U A0,address-of-packet<br />

LMJ X11,CBSDFO$-1<br />

error return<br />

normal return<br />

L,U A0,address-of-packet<br />

I$BJ X11,CBSDFO$<br />

error return<br />

normal return<br />

Relocatable<br />

L,U A0,address-of-packet<br />

LMJ X11,SDFO$<br />

error return<br />

normal return<br />

If SDFO takes the error return, register A4 contains the error code. See 21.3 for an<br />

explanation of error codes.<br />

If SDFO takes the normal return, the image has been successfully written to the file or<br />

element.<br />

21.2.2.3. Close SDFO<br />

After all images have been written, the calling program must close SDFO by calling the<br />

entry point SDFOC$. SDFO places an end-of-file control record (077 in S1 of the ICW) in<br />

the I/O buffer and writes the buffer out to the file or element. If SDFO is writing to mass<br />

storage, it returns a sector address in word 5. This is the next available address to write<br />

to in the file. If SDFO is writing to tape, an end-of-file mark is written to the tape.<br />

Calling Sequence for SDFOC$<br />

Auto Switch Common Bank or<br />

Relocatable<br />

L,U A0,address-of-packet<br />

LMJ X11,CBSDFOC$-1<br />

error return<br />

normal return<br />

L,U A0,address-of-packet<br />

I$BJ X11,CBSDFOC$<br />

error return<br />

normal return<br />

Relocatable<br />

L,U A0,address-of-packet<br />

LMJ X11,SDFOC$<br />

error return<br />

normal return<br />

7833 1733–004 21–17

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

Saved successfully!

Ooh no, something went wrong!