pTAL Conversion Guide

pTAL Conversion Guide527302-002
13-1
13 Expressions
This section describes differences between TAL and pTAL expressions in the following
areas:
Using 16-bit Operands and Operations on page 13-1
Using Unsigned Operators and INT(32) Operands on page 13-4
Comparing Addresses on page 13-6
Using Indexing on page 13-8
Using FIXED(*) Variables on page 13-9
Relational Operators and Condition Codes on page 13-10
Group Comparison Expressions on page 13-10
Using 16-bit Operands and Operations
This section gives considerations for using 16-bit operators and operands in the 32-bit
environment of native architecture.
Topics:
Using 16-bit Operators on page 13-1
Results After Overflow on page 13-2
Guaranteeing 16-Bit Results on page 13-3
Using 16-bit Operators
The result of a 16-bit signed operation might be different on TNS and native
architecture if the result of the operation cannot be stored in 16 bits. TNS processes
perform most arithmetic operations in 16-bit registers and, therefore, retain only the
low-order 16 bits of the result of most arithmetic operations. In TNS processes, most
operators discard significant bits above the low-order 16.
Native processes perform arithmetic in 32-bit registers. Except as noted in
Guaranteeing 16-Bit Results on page 13-3, a native process retains bits in the upper
half of a 32-bit result—which a TNS process would discard—for all operations;
therefore, the results of intermediate operations within an expression might be different
for TNS and native processes.