SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming Examples
SPI Programming Manual427506-006
E-15
Example E-5: Displaying SPI Buffer Contents With
TAL
Example E-5: Displaying SPI Buffer Contents With TAL
Example E-5 demonstrates the basic buffer manipulation activities illustrated in
Figure 2-6
on page 2-24. This TAL program uses DSM Template Services to display
the contents of the buffer after each manipulation. Run the program to see the
behavior of the SSGET special operation ZSPI-TKN-NEXTTOKEN.
Source File
SET0206
Object File
SET0206O
Example E-5. TAL File: Pointers, Lists, and ZSPI-TKN-NEXTTOKEN (page 1 of 3)
-- File name: SET0206
-- SPI EXAMPLE TAL 2-6
-- Figure 2-6. Pointer Manipulation and lists
?SYMBOLS, INSPECT
LITERAL
max^bufsize = 256; ! in bytes
?SOURCE SETCDECS
?NOLIST, SOURCE $system.system.extdecs0 (
? abend, debug, dnumout, fileinfo, initializer, myterm, numout,
? open, stop, writex,
? spi_buffer_formatfinish_, spi_buffer_formatnext_,
? spi_buffer_formatstart_,
? ssinit, ssgettkn, ssmovetkn,
? ssput, ssputtkn )
?LIST
?SOURCE SETCUTIL
?PAGE "PROC spitest MAIN"
PROC spitest MAIN;
BEGIN
bufsize := max^bufsize;
CALL initializer;
CALL myterm(termname);
CALL open(termname,term);
IF <> THEN CALL abend;
!