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

SPI Programming in TACL
SPI Programming Manual427506-006
8-2
TACL Definition Files
TACL Definition Files
TACL macros and routines must load the SPI standard definition file named
ZSPIDEF.ZSPITACL on the disk volume chosen by your site, and must also load the
definition files in TACL for all subsystems with which your program communicates. For
NonStop Kernel subsystems, the names of the definition files in TACL are of the form
ZSPIDEF.
subsysTACL, where subsys is the four-character subsystem abbreviation.
To avoid text buffer overflows during loading, load each definition file:
PUSH X
#LOAD / LOADED X / $volume.ZSPIDEF.subsysTACL
POP X
The LOADED option directs TACL to put the loaded variables into the variable named
in the option (here, X) instead of returning them in the expansion to #LOAD; #LOAD
then expands to nothing.
Declarations and Data Representations in
TACL
TACL processes data in both external format (displayable strings of ASCII characters)
and STRUCT format (binary data defined as a STRUCT). TACL provides a set of built-
in functions, described later in this section, that correspond to the SPI procedures. Two
different built-ins are available for SSGET functionality and two for SSPUT
functionality, so that you can pass and return token values in either format.
When you pass parameters to and receive results from these built-ins:
The SPI buffer must be in STRUCT format.
The subsystem ID must be in external format when it is passed as the ssid
parameter to a built-in. When it is passed or returned as a token value, its
representation depends on the built-in, as is true for other token values.
Token codes can be in either external or STRUCT format.
Token maps (and token codes of token data type ZSPI^TDT^STRUCT) must be in
STRUCT format.
Token values passed to the #SSPUT built-in must be in external format, and token
values returned from the #SSGET built-in are always in external format (returned in
the expansion of the built-in).
Token values passed to the #SSPUTV and #SSMOVE built-ins must be in
STRUCT format, and token values returned from the #SSGETV and #SSMOVE
built-ins are always in STRUCT format.
Most other parametersincluding the count, index, command, object type,
maximum responses, server version, and checksum parametersmust be in
external format.