pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
3 Data Representation
A program operates on data—variables and constants—which it stores in the storage units that
Table 17 (page 46) describes.
Table 17 Storage Units
DescriptionNumber of BitsStorage Unit
Smallest addressable unit of memory.8Byte
2 bytes, with byte 0 (most significant) on the left and byte 1 (least significant)
on the right
16Word
4 bytes32Doubleword
8 bytes64Quadrupleword
Contiguous bit fields within 2 bytes1-16n-bit field
Contiguous bit fields within 4 bytes17-31
Topics:
• Data Types (page 46)
• Address Types (page 49)
• Constants (page 57)
Data Types
When you declare a variable, you specify its data type, which determines:
• Its storage unit
• The values that you can assign to it
• The operations that you can perform on it
• Its address type
Table 18 Data Types
Values the Data Type Can Represent
Storage Unit
1
Data Type
ByteSTRING
• ASCII character
• Unsigned 8-bit integer in the range 0 through 255
Word
• String of one or two ASCII characters
INT
INT(16)
2
• Unsigned 6-bit integer in the range 0 through 65,535
• Signed 6-bit integer in the range -32,768 through 32,767
32-bit integer in the range -2,147,483,648 through +2,147,483,647DoublewordINT(32)
32-bit floating-point number in the range ±8.6361685550944444E-78
through ±1.15792089237316192E, precise to approximately 6.5
significant decimal digits.
DoublewordREAL
REAL(32)
3
64-bit fixed-point number. For FIXED, FIXED(0), FIXED (*), and INT(64)
the range is -9,223,372,036,854,775,808 through
+9,223,372,036,854,775,807.
QuadruplewordFIXED
FIXED(0)
INT(64)
4
FIXED(-19 to -1)
FIXED(1 to 19)
46 Data Representation