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

SPI Programming Manual427506-006
E-1
E SPI Programming Examples
This appendix lists the TAL source code and C source code for six programs that
demonstrate basic SPI concepts and programming techniques. In addition to these
twelve working example programs, there are eight supporting files (four in TAL and
four in C), one TACL command file for compiling the TAL programs, and one TACL
command file for compiling the C programs.
The source code presented in this appendix is for working programs, supporting files,
and one command file each for compiling the TAL and C programs.
Source files for these example programs are distributed in the subvolume ZSPIEXAM.
Working Programs
Example Description Source File Page
E-1 A TAL program that demonstrates the basic buffer
operations shown in Figure 2-4
on page 2-18. This
example shows how to initialize a buffer, put tokens into
the buffer, reset the buffer, and get tokens from the
buffer.
SET0204 E-4
E-2 The C program equivalent of Example E-1 SEC0204 E-7
E-3 A TAL program that demonstrates the basic buffer
operations shown in Figure 2-5 on page 2-22. This
example shows how to move in and out of lists and
retrieve tokens from within a list.
SET0205 E-9
E-4 The C program equivalent of Example E-3 SEC0205 E-12
E-5 A TAL program that performs the basic buffer operations
shown in Figure 2-6 on page 2-24. This example
demonstrates the behavior of the special SSGET
operation ZSPI-TKN-NEXTTOKEN in and around lists.
SET0206 E-15
E-6 The C program equivalent of Example E-5 SEC0206 E-18
E-7 A TAL program that performs the basic buffer operations
shown in Figure 2-7
on page 2-26. This example
demonstrates the behavior of the special SSGET
operation ZSPI-TKN-NEXTCODE in and around lists.
SET0207 E-21
E-8 The C program equivalent of Example E-7 SEC0207 E-24
E-9 A simple SPI requester that interacts with the server
program in Example E-11. This example demonstrates
fundamental SPI requester activities, including response
continuation.
SETREQR E-27