HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
G- 17
c_bytes_per_pointer = 4;
c_bytes_per_integer = 4;
c_bytes_per_32_bit_word = 4;
c_bytes_per_16_bits = 2;
{----------------------------------------------------------------------------}
{ t_basic_data_types }
{ An enumerated type that associates a data type with a value. Used as a }
{ field selector for variant records to associate the relevant variant with }
{ the data type. }
{----------------------------------------------------------------------------}
type
t_basic_data_types = { 0 } ( basic_sinteger_type,
{ 1 } basic_integer_type,
{ 2 } basic_short_decimal_type,
{ 3 } basic_decimal_type,
{ 4 } basic_short_type,
{ 5 } basic_real_type,
{ 6 } basic_string_type
);
{----------------------------------------------------------------------------}
{ Data types that have corresponding Pascal data types. }
{----------------------------------------------------------------------------}
type
t_short_integer_type = shortint;
t_integer_type = integer;
t_short_real_type = real;
t_real_type = longreal;
$page$
{----------------------------------------------------------------------------}
{ DECIMAL data type }
{----------------------------------------------------------------------------}
const
c_dec_positive_mantissa = 12;
c_dec_negative_mantissa = 13;
type
t_shortint_rep_decimal = array [1..4] of shortint;
t_dec_digit_pack = packed array [-2..12] of 0..9;
t_decimal_exponent_mantissa_sign_rep =
packed record
exponent : -511..511; { 10 bits }
alignment_1_filler : 0..63; { 6 bits }
alignment_2_filler : shortint; { 16 bits }
alignment_3_filler : shortint; { 16 bits }
alignment_4_filler : -2048..2047; { 12 bits }
mantissa_sign : c_dec_positive_mantissa..
c_dec_negative_mantissa { 4 bits }
end;
{----------------------------------------------------------------------------}
{ DECIMAL TYPE }
{ The first variant of the record is designed to serve as a record overlay }
{ to quickly access the exponent and mantissa sign fields of the DECIMAL }
{ representation of a number. }
{ 1 1 1 1 1 1 }
{ bits: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 }
{ shortint |===============================================================| }
{ [1] |<-------------- exponent ------------->|<- alignment_1_filler->| }
{ |===============================================================| }
{ [2] |<-------------------- alignment_2_filler --------------------->| }
{ |===============================================================| }
{ [3] |<-------------------- alignment_3_filler --------------------->| }
{ |===============================================================| }
{ [4] |<-------------- alignment_4_filler ----------->|<mantissa sign>| }
{ |===============================================================| }