Nios® V Processor Software Developer Handbook

ID 743810
Date 7/20/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.4. Data Widths and the HAL Type Definitions

For embedded processors such as the Nios® V processor, it is often important to know the exact width and precision of data. Because the ANSI C data types do not explicitly define data width, the HAL uses a set of standard type definitions instead. The ANSI C types are supported, but their data widths are dependent on the compiler’s convention.

The header file alt_types.h defines the HAL type definitions.

Table 22.  The HAL Type Definitions
Type Meaning
alt_8 Signed 8-bit integer.
alt_u8 Unsigned 8-bit integer.
alt_16 Signed 16-bit integer.
alt_u16 Unsigned 16-bit integer.
alt_32 Signed 32-bit integer.
alt_u32 Unsigned 32-bit integer.
alt_64 Signed 64-bit integer.
alt_u64 Unsigned 64-bit integer.
Table 23.  GNU Toolchain Data Widths
Type Meaning
char 8 bits.
short 16 bits.
long 32 bits.
int 32 bits.