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.

4.2.4.3. Example<br />

AEDIT$–ASCII Image Composition Editing Package<br />

The following example shows a MASM program that creates an ASCII string with date<br />

and time formats using the relocatable version of AEDIT$.<br />

$ASCII<br />

$INCLUDE ‘MAXR$’<br />

$(2)<br />

PKT A$EDITPKT 15,DATELINE ‘DFT’,8 ‘TFT’,3 . AEDIT$ packet<br />

DATELINE $RES 15 . Image buffer<br />

MSG ‘Current date and time:’ . Output string<br />

$(1)<br />

START<br />

A$EDIT PKT . Enter edit mode<br />

A$ECOPY 23,MSG . Copy 23 character string<br />

A$ESFDT . Edit the date and time<br />

J ERROR . Jump if error occurred<br />

A$EPRINT . Print out edited string<br />

J DONE .<br />

ERROR . Error return<br />

L$SNAP ‘SFDT’,2 . Dump A-registers<br />

DONE .<br />

ER EXIT$<br />

$END START<br />

This MASM program calls the relocatable version of AEDIT$ to create and print the<br />

following ASCII string:<br />

Current date and time: 1983 Sep 10 Sat 1643:14.057<br />

In this example, AEDIT$ generates the ASCII string in the 15-word data area DATELINE.<br />

The AEDIT$ packet is generated by the A$EDITPKT procedure using date format 8 and<br />

time format 3.<br />

The A$EDIT procedure initializes the AEDIT$ packet at location PKT and enters edit<br />

mode. The A$ECOPY procedure copies 23 characters from location MSG to the data<br />

area (including one space character following the colon). The A$ESFDT procedure call<br />

generates the standard date and time format string in the data area. Since no date or<br />

time parameters are specified on the A$ESFDT procedure call, the current date and time<br />

are used.<br />

If A$ESFDT takes the error return, the A-registers are dumped by the L$SNAP procedure<br />

call. Otherwise, the A$EPRINT procedure prints the image generated at location<br />

DATELINE by executing an ER APRINT$. Edit mode is then exited.<br />

7833 1733–004 4–23

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

Saved successfully!

Ooh no, something went wrong!