Several operating modes of arm in embedded systems and the priority of abnormal Modes

Source: Internet
Author: User
Tags prefetch

I. Arm working mode:

ARM microprocessor supports seven working modes:

1.User Mode (usr)Used for normal Program Execution

2.Fast interrupt mode (FIQ)For high-speed data transmission

3.IRQ) For normal interrupt handling

4.Management Mode (SVC)Operating system protection mode (high permission), reset and software interruption

5.Data Access termination mode (ABT)This mode is used for virtual memory and storage protection when data or command prefetch is terminated.

6.System Mode (sys)Run operating system tasks with privileges

7.Undefined instruction termination mode (UND)Software Simulation (floating point and micro operation) supporting hardware coprocessor)

In addition to the user mode, all the other six modes are called the non-user mode (privileged mode, with higher permissions than the user mode ),

In the privileged mode, five modes except the system mode are called the exception mode (in the user mode and system mode, these are all exceptions), which are often used to handle interruptions or exceptions, and access to protected system resources.

The priority of the exception mode is as follows:

1 (maximum) SVC reset 2 Data abort 3 FIQ (fast interrupt request) 4 IRQ (external interrupt request) 5 abt prefetch command abort 6 (minimum) und undefined command, SWI

 

From the programming point of view, the ARM microprocessor has two working states and can switch between them:

(1)Arm status,In this case, the processor executes the 32-bit arm command

(2)Thumb status,At this time, the processor executes the 16-bit, half-aligned thumb command.

(To be compatible with the old chip) You can switch between the two states while running the program.

The change of the processor's working status does not affect the working mode of the processor and the content in the corresponding register.

Ii. Memory Format (Word Alignment ):

The ARM architecture regards memory as a linear combination of bytes starting from zero addresses.

From 0 ~ 3 bytes of the first stored word (32-bit) data,

From 4 ~ Seven bytes are placed in the second storage of word data, arranged at a time. As a 32-bit microprocessor, the maximum addressing space supported by the ARM architecture is 4 GB.

Memory Format:

The ARM architecture can store word data in two ways.Large-end formatAndSmall-end format (as described in the previous chapter).

Large-end format: the high byte of word data is stored in the low address, while the low address of word data is stored in the high address. Intuitive

Small-end format: opposite to the large-segment format. Easy computer storage

For example, int ox12345678

Large End: 12 34 56 78

Small shard: 78 56 34 12

Iii. Instruction length:

The instruction length of the ARM microprocessor is 32 bits, or 16 bits (in the thumb State ). ARM microprocessor supports three data types: byte (8 bits), half-character (16 bits), and word (32 bits). Among them, the word must be 4-byte aligned, the half word must be 2 bytes aligned.

Note: the so-called instruction length is the length of a complete instruction, rather than simply the length of the three letters mov

 4. Switch the operating mode of ARM

There are two methods:

Passive switch: When the arm is running, some exceptions or interruptions are generated to switch the mode.

Active switch: The software changes, that is, the software sets registers to switch the arm mode, because the arm working mode can be switched by assigning values to the corresponding registers.

Note: When the processor runs in user mode, some protected system resources cannot be accessed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.