Table 1-1. Word and Integer Conversions

Bits

Native Mode (NM)

 

Compatibility Mode (CM)

 

 

 

 

16

1 halfword or shortin t

1

CM word or integer

32

1 word or integer

 

CM words, double integers, or

2

 

 

double words

64

2 words

4

CM words

 

 

 

 

Integers in MPE/iX can be 16 or 32 bits long, signed, or unsigned. Signed in tegers are in twos complement form. Halfword in tegers (16-bit) are stored in memory at ev en byte addresses, and word integers (32-bit) at addresses divisible b y four.

Real numbers in MPE/iX are stored in one of t wo ￿oating-point formats. The t wo methods of storing ￿oating-poin t numbers in the MPE/iX en vironment are: HP 3000 format, and according to IEEE T ask P854. The default MPE/iX Native Mode (NM) real n umber representation conforms to IEEE T ask P854. This standard speci￿es a storage format di￿eren t than that used in MPE V/E-based HP 3000 systems. The real n umber format for a particular application can be forced to the HP 3000 represen tation by specifying the HP3000 16 compiler directiv e. Since this compiler directiv e selects both MPE V/E alignmen t and real number format, nativ e aligned data must then be aligned on a per record basis.

A single source module can use only one real n umber format, but the HPFPCONVERT intrinsic converts real numbers between the various formats. Separate (external) procedures ma y use di￿erent formats. The formats ha ve di￿erent precisions and ranges for both single-precision and double-precision real n umbers.

Because of accuracy di￿erences bet ween IEEE and HP 3000 double real n umbers, the least signi￿cant digit may be lost in 16-digit real n umbers. Since the HP 3000 double precision range is smaller than the IEEE double real range, con version from a v ery large or small one in IEEE to one in HP 3000 ma y cause an over￿ow or under￿ow.

For a comparison of the real n umber representation on MPE V/E and MPE/iX, refer to Introduction to MPE/iX for MPE V Pr ogrammers (30367-90005).

Figure 1-12 and Figure 1-13 sho w the internal representation for ￿oating-poin t numbers on MPE/iX.

Figure 1-12. IEEE Single-precision Real Number Format

OVERVIEW 1-31