CMSIS-Core (Cortex-A): Current Program Status Register (CPSR)

| CMSIS-Core (Cortex-A) Version 1.1.2 CMSIS-Core support for Cortex-A processor-based devices

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Content | Data Structures | Functions
Current Program Status Register (CPSR)
Core Register Access

The Current Program Status Register (CPSR) holds processor status and control information. More...

## Content
| CPSR Bits
| Bit position and mask macros.
| CPSR M field values
| Valid values for CPSR M field.

## Data Structures
struct | CPSR_Type
| Bit field declaration for CPSR layout. More...

## Functions
__STATIC_INLINE uint32_t | __get_CPSR (void)
| Get CPSR (Current Program Status Register) More...
__STATIC_INLINE void | __set_CPSR (uint32_t cpsr)
| Set CPSR (Current Program Status Register) More...

## Description

The individual register bits have the following meaning:

Bits | Name | Function
--- | --- | ---
[31] | N | Negative condition code flag
[30] | Z | Zero condition code flag
[29] | C | Carry condition code flag
[28] | V | Overflow condition code flag
[27] | Q | Cumulative saturation bit
[26:25] | IT[1:0] | If-Then execution state bits for the Thumb IT (If-Then) instruction
[24] | J | Jazelle bit
[19:16] | GE | Greater than or Equal flags
[15:10] | IT[7:2] | If-Then execution state bits for the Thumb IT (If-Then) instruction
[9] | E | Endianness execution state bit: 0 - Little-endian, 1 - Big-endian
[8] | A | Asynchronous abort mask bit
[7] | I | IRQ mask bit
[6] | F | FIRQ mask bit
[5] | T | Thumb execution state bit
[4:0] | M | Mode field

Consider using __get_CPSR and __set_CPSR for accessing this register.

## Function Documentation

__STATIC_INLINE uint32_t __get_CPSR | ( | void |  | ) |

Returns
  CPSR Register value

This function returns the content of the Current Program Status Register (CPSR).

__STATIC_INLINE void __set_CPSR | ( | uint32_t | cpsr | ) |

Parameters

  [in] | cpsr | CPSR value to set

This function assigns the given value to the Current Program Status Register (CPSR).