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.

11.1.3. Examples<br />

ID$–Identification Line Routine<br />

The following example calls the ID$ routine to generate an ASCII identification line.<br />

$ASCII<br />

$INCLUDE ‘MAXR$’<br />

$(2)<br />

IDPAC I$DPKT ‘IDLINE’ ‘Math Quiz Program (Level 8)’ 026<br />

$(1)<br />

START<br />

I$D$ IDPAC . Generate and print the ID line<br />

J ERROR . Jump ahead if error return<br />

.<br />

. (Program code)<br />

.<br />

J DONE . Program complete<br />

ERROR<br />

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

DONE<br />

ER EXIT$<br />

$END START<br />

This MASM routine uses the ID$ routine to create and print the following identification<br />

line:<br />

Math Quiz Program (Level 8) 840425 1147:31<br />

In this example, ID$ generates the ASCII identification line in the 11-word data area at<br />

location IDLINE. The I$DPKT procedure generates the ID$ packet (see11.2.2 for details<br />

on the I$DPKT packet generation PROC).<br />

The I$D$ procedure calls the relocatable version of ID$, which generates the<br />

identification line and prints it by executing an ER APRINT$ (because option bit 4 is set).<br />

If ID$ takes the error return, L$SNAP prints the A-registers. Otherwise, the program<br />

continues executing.<br />

7833 1733–004 11–7

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

Saved successfully!

Ooh no, something went wrong!