The Definitive Guide to the ARM Cortex-M3

Several Useful Instructions in the Cortex-M3

Several useful Thumb-2 instructions from the architecture v7 and v6 are introduced here.

MSR and MRS

These two instructions provide access to the special registers in the Cortex-M3. Here is the syntax of these instructions:

      MRS ,  ; Move from Special Register      MSR ,  ; Write to Special Register

where could be one of the options shown in Table 4.31.

Table 4.31: Special Register Names for MRS and MSR Instructions

Symbol

Descrip tion

IPSR

Interrupt status register

EPSR

Execution status register (read as zero)

APSR [a]

Flags from previous operation

IEPSR

A composite of IPSR and EPSR

IAPSR

A composite of IPSR and APSR

EAPSR

A composite of EPSR and APSR

PSR

A composite of APSR, EPSR and IPSR

MSP

Main stack pointer

PSP

Process stack pointer

PRIMASK

Normal exception mask register

BASEPRI

Normal exception priority mask register

BASEPRI_MAX

Same as normal exception priority mask register, with conditional write (new priority level must be higher than the old level)

FAULTMASK

Fault exception mask register (also disables normal interrupts)

CONTROL

Control register

[a]In older ARM Cortex-M3 documents, the APSR was called FPSR. If you are using older software development tools that were developed during the early stages of Cortex-M3 development, you might need to use the register name FPSR in your assembly code.

For example, the following code can be used to set up the Process Stack Pointer:

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Lithography Equipment
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.