C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

The return type value can be any of these:
MeaningReturn Type Value
The TAL routine does not return a value.void
The TAL routine returns a value. Specify one of, or a pointer to one of, the
character, integer, or floating-point types.
fundamental-type
The TAL routine does not return a value but does set a condition code. The tal.h
header file contains six macros that interrogate this condition code:
_cc_status
_status_lt(x), _status_le(x), _status_eq(x), _status_ge(x),
_status_gt(x), and _status_ne(x).
For information on calling TAL routines that both return a value and set a condition code (CC), see
TAL Procedures That You Cannot Directly Call (page 105).
Here are examples of interface declarations for calling TAL routines:
_tal _variable short SEGMENT_ALLOCATE_ (short, long,
short *, short);
_tal _variable _cc_status SEGMENT_DEALLOCATE_ (short, short);
_tal _variable _cc_status READ (short, short *, short,
short *, long);
_tal _extensible _cc_status READX (short, char _far *,
short, short *, long);
_tal _alias ("tal^name") void c_name (short *);
After specifying an interface declaration, use the normal C routine call to access the TAL routine.
This example shows a large-memory-model TNS C module that calls a TAL routine:
C Code
#include <stdioh> nolist
short arr[5]; /*stored in extended segment */
_tal _alias ("tal^name") void C_Name (short _far *);
void func1 (short *xarr)
{
C_Name (xarr);
printf ("xarr[2] after TAL = %d", xarr[2]);
}
main ()
{
arr[4] = 8;
func1 (arr);
}
TAL Code
PROC tal^name (a);
INT .EXT a; !32-bit pointer
BEGIN
a[2] := 10;
END;
TAL Procedures That You Cannot Directly Call
Your TNS C program cannot directly call a TAL procedure that both returns a value and sets the
condition code register.
Interfacing to TAL 105