TNS/R Native Application Migration Guide

TNS/R Native Application Migration Guide523745-001
5-1
5 TAL to pTAL Conversion Tasks
The HP Transaction Application Language (TAL) is a higher-level, block-structured
language used to write system software and transaction-oriented applications for
NonStop servers.
The Portable Transaction Application Language (pTAL) is a dialect of TAL. pTAL does
not depend on architecture-specific characteristics of HP NonStop Series (TNS)
processors. pTAL has constructs that replace architecture-specific TAL constructs and
that take advantage of HP NonStop Series/RISC (TNS/R) processors. pTAL also
tightens the rules on using certain TAL constructs and operations.
The compilers to which this section applies are:
Some of the changes required to convert from TAL to pTAL include:
Replace INT and INT(32) declarations holding addresses with new address types
WADDR, BADDR, and EXTADDR.
Test condition codes, such as with IF $OVERFLOW, immediately following the
statement returning the condition.
Add explicit returns at the bottom of functions.
Declare procedure pointers using new pTAL syntax.
Specify a RETURNSCC attribute in procedures that return condition codes.
Remove CODE, STACK, and STORE statements.
Rewrite code that uses G,S, or L-relative addresses.
pTAL does not support embedded SQL statements. To convert a TAL program with
embedded SQL to pTAL, write C functions that contain the embedded SQL statements
and call the C functions from pTAL.
Many TAL programs require few changes to create valid pTAL programs. However,
TAL programs that make use of low-level TNS architecture features might require
significant changes.
The pTAL compilers syntax checking option can be used to identify most TAL
constructs that must be changed to convert TAL code to pTAL code. The pTAL
compiler syntax checking option produces a detailed listing of items that must be
changed. In Example 5-1 on page 5-2, the variable I must be declared as a WADDR.
Compiler T Number
TNS/R pTAL T9248
TNS TAL T9250