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.

FDASC$–Fieldata/ASCII Data Conversion<br />

Auto Switch Common Bank or Relocatable Relocatable<br />

L,U A0,input-buffer-word- count<br />

L,U A1,input-buffer-address<br />

L,U A2,output-buffer-address<br />

LMJ X11,CBFDASC$-1<br />

normal return<br />

L,U A0,input-buffer-word- count<br />

L,U A1,input-buffer-address<br />

L,U A2,output-buffer-address<br />

I$BJ X11,CBFDASC$<br />

normal return<br />

L,U A0,input-buffer-word- count<br />

L,U A1,input-buffer-address<br />

L,U A2,output-buffer-address<br />

LMJ X11,FDASC$<br />

normal return<br />

FDASC$ converts the Fieldata characters in the input buffer (six characters per word) to<br />

ASCII and places them into the output buffer (four characters per word, with trailing<br />

space-fill if necessary). The length of the output buffer in words must be at least 1-1/2<br />

times the length of the input buffer. The input buffer and the output buffer may specify<br />

the same buffer, since the string is converted tail-to-head to prevent overwriting.<br />

FDASC$ returns the word length of the converted ASCII image in register A0.<br />

Example<br />

The following example demonstrates a call to the relocatable version of FDASC$ to<br />

convert a Fieldata character string to ASCII:<br />

$FDATA<br />

$INCLUDE ‘MAXR$’<br />

$(2)<br />

INBUF ‘SOME FIELDATA CHARACTERS.’ . Fieldata character string<br />

INLEN $EQU $-INBUF . Word length<br />

OUTBUF $RES INLEN*3//2 . Output buffer<br />

PCW $GFORM 12,1, 6,0, 18,OUTBUF . Print Control Word<br />

$(1)<br />

START<br />

L,U A0,INLEN . Input string word length<br />

L,U A1,INBUF . Input string address<br />

L,U A2,OUTBUF . Output buffer address<br />

LMJ X11,FDASC$ . Convert FD to ASCII<br />

.<br />

S,S3 A0,PCW . Put word length of<br />

L A0,PCW . converted image in PCW<br />

ER APRINT$ . Print ASCII image<br />

.<br />

ER EXIT$ .<br />

$END START .<br />

This MASM routine calls the relocatable version of FDASC$ to convert the Fieldata string<br />

at INBUF to ASCII. The word length of the converted image is returned from FDASC$ in<br />

A0. An ER APRINT$ prints the converted image.<br />

9–2 7833 1733–004

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

Saved successfully!

Ooh no, something went wrong!