TAL Programmer's Guide
CRE Guidelines for TAL
Mixed-Language Programming
17–50 096254 Tandem Computers Incorporated
CRE Sample Program Example 17-2 shows the source code of a D-series program written for the CRE. This
program contains a TAL routine that calls a C routine, each of which displays a
greeting.
Example 17-2. D-Series CRE Sample Program (Page 1 of 2)
TAL Code
?SYMBOLS, INSPECT
?ENV COMMON
NAME talsrc;
!Source in CRE run-time library routines:
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM CREDECS (FILE)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM CREDECS (
? TERMINATION)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM CREDECS (
? CRE_FILE_CLOSE_,
? CRE_FILE_OPEN_,
? CRE_LOG_MESSAGE_,
? CRE_TERMINATOR_)
?POPLIST
!Source in TAL run-time library routine:
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM TALDECS (
? TAL_CRE_INITIALIZER_)
?POPLIST
PROC c_routine LANGUAGE C;
EXTERNAL; !Declare EXTERNAL C routine
PROC talmain MAIN;
BEGIN
STRING .msg[0:13] := "Hello from TAL";
CALL TAL_CRE_INITIALIZER_;
CALL CRE_FILE_OPEN_ (cre^standard^log);
CALL CRE_LOG_MESSAGE_ (msg:14);
CALL c_routine;
CALL CRE_FILE_CLOSE_ (cre^standard^log);
CALL CRE_TERMINATOR_ (cre^completion^normal);
END;