HPlogo DATA TYPES CONVERSION Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Introduction

Defining Data Types

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The designers of the computer define certain primitive system data types in order to receive input, store or manipulate data, and return information in a predictable way.

How a process will use data input depends on the context. If a process requires a certain data type, it will attempt to interpret input as that type. For example, if you pass 32 binary bits to an intrinsic parameter that requires a file address, it may attempt to access the cell at that location in memory. If you pass the same 32 bits to a parameter that requires a character array, it may print a four-letter word. If you pass the same 32 bits to a parameter that requires a 64-bit floating-point real value, you may cause an error or program abort.

Primitive Data Types

The HP-PA instruction set is designed to operate on certain fundamental data types. The following data types are recognized by MPE XL and its subsystems:

  • Characters.

  • The following numeric types:

    • Integers.

    • Real numbers (in floating-point notation).

    • Decimal.

NOTE: Although decimal is not really a system primitive type, it is included in this manual because it is so widely used on MPE XL. Floating-point decimals are used by BASIC; packed and unpacked decimals are used by COBOL and RPG.

Intrinsic Data Types

The compilers of high-level languages running on MPE XL have mechanisms to access the system-defined procedures called intrinsics. MPE XL intrinsic parameters recognize the following data types:

  • Address (@).

  • Array (A).

  • Boolean (B).

  • Character (C).

  • Integers: Signed (I) and Unsigned (U).

  • Real (R).

  • Record (Rec).

Character, integer, and real numbers are system primitive types. Address and Boolean types are numbers with special uses. Array and record are structures that group data.

Language Data Types

Some high-level programming languages running on MPE XL define their own data types based on the primitive types. The language compiler makes any necessary conversions between the primitive data types and the language-dependent data types. This conversion is transparent to the programmer. These types are described in the appropriate language manuals in the Language Manual Series.

Languages may simply rename the primitive type, like the integer, a system type common to all languages. Languages may use the system types as building blocks to create a more complex data structure. For example, the array is not a primitive type, but is defined by programming languages as a connected group of data, all of the same type.

Feedback to webmaster