uboot-2011.12 ported to S3C2440 (Sequence 5) - ARM register description

Publisher:闪耀星空Latest update time:2022-04-22 Source: eefocusKeywords:uboot Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Refer to "Detailed Explanation of ARM Application System Development"

There are three main types of registers R0~R15 in the ARM architecture:

@Ungrouped registers R0~R7

@Group register R8~R14

@PC register R15


Ungrouped registers

The same register name corresponds to only one independent physical register inside the ARM microprocessor.


Group register

Each physical register corresponds to a different processor mode. For R8~R12, each register corresponds to two different physical registers. When using fiq mode, access registers R8_fiq~R12_fiq; when using other modes except fiq mode, access registers R8_usr~R12_usr. For R13 and R14, each register corresponds to 6 different physical registers, one of which is shared by user mode and system mode, and the other 5 physical registers correspond to the other 5 different operating modes.


Register R13

It is often used as a stack pointer in ARM instructions, but this is just a convention.


R14

Also called the Subroutine Link Register or Link Register LR. When the BL subroutine call instruction is executed, R14 gets a copy of R15.




An example of using the R14 register is: when a subroutine is called using the BL or BLX instruction, the current value of the PC is copied to R14. After the subroutine is executed, the value of R14 is copied back to the PC to complete the call and return of the subroutine.



Subroutine return instruction: MOV PC, LR or BX LR


Store R14 on the stack: STMFD SP!,{,LR}


Pop R14 when the subroutine returns: LDMFD SP!, {, PC}


Program counter PC (R15)

In ARM mode, PC bits [1:0] are 0, and bits [31:2] are used to store PC; in Thumb mode, bit [0] is 0, and bits [31:1] are used to store PC. (Complies with the word alignment rules of ARM microprocessors: 32-bit or 16-bit instruction length, and storage is in bytes). For the ARM instruction set, PC always points to the next two instructions of the current instruction. That is, the value of PC is the address value of the current instruction plus 8 bytes.


Register R16

Register R16 is used as the current program status register CPSR


Condition Code Flags

N, Z, C, and V are all conditional code flags. Their contents can be changed by the results of arithmetic or logical operations, and can determine whether an instruction is executed. In ARM state, most instructions are executed conditionally.

When N is used to perform operations on signed numbers represented by two's complement, N=1 indicates that the result of the operation is a negative number; N=0 indicates that the result of the operation is a positive number or zero;

Z Z=1 means the result of the operation is zero; Z=0 means the result of the operation is non-zero;

C can have 4 ways to set the value of C:

─ Addition operation (including comparison instruction CMN): When the operation result produces a carry (unsigned number overflow), C=1, otherwise C=0.

─ Subtraction operation (including comparison instruction CMP): When a borrow occurs during the operation (unsigned overflow), C=0, otherwise C=1.

─ For non-addition/subtraction instructions that include shift operations, C is the last bit of the value shifted out.

─ For other non-addition/subtraction operation instructions, the value of C usually does not change.

There are two ways to set the value of V:

─ For addition/subtraction operation instructions, when the operands and the operation results are signed numbers represented by binary's complement, V=1 indicates sign bit overflow.

─ For other non-addition/subtraction operation instructions, the value of V usually does not change


Control bit

The lower 8 bits of PSR (including I, F, T, and M[4:0]) are called control bits, which can be changed when an exception occurs. If the processor runs in privileged mode, these bits can be modified by the program.


─ Interrupt disable bits I, F: I=1 disables IRQ interrupt; F=1 disables FIQ interrupt.


─ T flag: This bit reflects the running state of the processor. For T series processors of ARM architecture v5 and above, when this bit is 1, the program runs in Thumb state, otherwise it runs in ARM state. For non-T series processors of ARM architecture v5 and above, when this bit is 1, executing the next instruction causes a defined instruction exception, and when this bit is 0, it means running in ARM state.


─ Operation mode bits M[4:0]: M0, M1, M2, M3, M4 are mode bits. These bits determine the operation mode of the processor.


Reserved bits

SPSR

Each operating mode has a dedicated physical status register called SPSR (Saved Program Status Register). When an exception occurs, SPSR is used to save the current value of CPSR, and SPSR can restore CPSR when exiting from the exception.


Since user mode and system mode are not exception modes, they do not have SPSR. When accessing SPSR in these two modes, the result is unknown.


Keywords:uboot Reference address:uboot-2011.12 ported to S3C2440 (Sequence 5) - ARM register description

Previous article:uboot-2011.12 ported to S3C2440 (Part 3) - Hardware initialization: watchdog, interrupt, clock
Next article:Overview of the instruction set of ARM microprocessors (I) - Detailed notes on ARM application system development

Recommended ReadingLatest update time:2024-11-16 14:58

JZ2440 transplant uboot
Development board: JZ2440V3 U-Boot version: u-boot-2012.04.01 1. First download the source code, upload it to the server, and decompress it. tar -jxvf u-boot-2012.04.01.tar.bz2 2. Create a new project. This version of uboot comes with the smdk2410 project. By reading the README file in the root directory of th
[Microcontroller]
S3C2440 LCD driver code template (RealView MDK)
A good memory is not as good as a bad pen. In order to facilitate the code review and code reuse in the future, here is the S3C2440 LCD control initialization code. Use the friendly MINI2440 development board, the LCD is 320*240, and the development environment is RealView MDK 4.22. The source code structure is simple
[Microcontroller]
S3C2440 storage controller learning record
/==========Translate S3C2440 storage controller part================/ 5 Storage Controller Overview The S3C2440 memory controller provides memory control signals for external memory access. S3C2440A has the following features: Big endian/little endian (selected by software) Address spac
[Microcontroller]
S3C2440 storage controller learning record
I2S Audio Bus Learning (Part 3) S3C2440 I2S Controller
In our own product test, the submachine runs normally in normal mode without any problems. However, if the remote host keeps sending data, the product LCD screen will be distorted and the serial port will freeze. Moreover, the two machines, the one that displayed the LCD screen distorted and then froze after the s
[Microcontroller]
I2S Audio Bus Learning (Part 3) S3C2440 I2S Controller
S3C2440 bare metal ------- exceptions and interrupts __ CPU working mode and status and registers
1.CPU working mode (Mode) ARM CPU has seven modes, as shown in the figure below. Note that you cannot enter other modes in user mode. User mode is used for applications when there is an operating system. The level of application writers varies greatly, and there is no guarantee that the programs they write are good or
[Microcontroller]
S3C2440 bare metal ------- exceptions and interrupts __ CPU working mode and status and registers
S3C2440 Linux driver transplantation——LED heartbeat
Development board: TQ2440 Kernel: Linux 2.6.32 PC OS:Ubuntu 11.04     This article will explain the transplantation of LED drivers. The LED in this article is used to realize heartbeat, that is, after the system is started, the LED will flash at a fixed frequency like a human heart. Unless the system freezes, the LE
[Microcontroller]
S3C2440 Linux driver transplantation——LED heartbeat
Experience of porting uboot to S3C44B0X development board
(1) Origin of the incident  A few months ago, I got a board designed based on the Micetek EV44b0-II development board from a friend. I felt very good about its bootloader MBL. My friend said it might be a port of u-boot. But Micetek did not provide the source code of MBL, so I did not study it carefully at that time.
[Microcontroller]
Application of s3c2440 real-time clock
The main function of the real-time clock (RTC) is to use the backup power supply to keep the clock running when the system loses power, so that the time information will not be lost.   The s3c2440 has an integrated RTC module, and it is also very simple to use. Its internal registers BCDSEC, BCDMIN, BCDHOUR, BCDDAY,
[Microcontroller]

Recommended posts

[National Technology N32G457 Review] 8 Solve the problem of unsuccessful SPI and CAN device mounting
ItesteditthismorningandenabledSPIandCANaccordingtothetutorial,butIdidn'tseethespiandCANdevicesinthedevicemanager.AftersearchingforinformationandcoordinatingwiththemoderatorandNationalTechnology,Isuccessfull
lugl4313820 Domestic Chip Exchange
In-depth disassembly | The magical use of Qorvo chips in handheld vacuum cleaners
Inrecentyears,drivenbyDyson,theportablehandheldvacuumcleanermarkethasdevelopedrapidly.However,judgingfromthemarketresponse,thepricesofsuchvacuumcleanersvarygreatly,andtheuserexperienceisevenmoredifficulttodescr
soso Power technology
Prize-winning live broadcast: MPS's new generation of micro-power isolated power module MIE series product introduction is in progress!
Prize-winninglivebroadcast:MPS'snewgenerationofmicro-powerisolatedpowermoduleMIEseriesproductintroductionisinprogress! ScantheQRcodebelowwithWeChatonyourmobilephoneandfollowthepromptstowatchthelivebroadcast!
EEWORLD社区 Power technology
MSP430 MCU Development Record (10)
ThiscontentisoriginallycreatedbyEEWORLDforumusertiankai001.Ifyouneedtoreprintoruseitforcommercialpurposes,youmustobtaintheauthor'sconsentandindicatethesource.MSP430MCUDevelopmentRecord(10)Ph
tiankai001 Microcontroller MCU
【AT-START-F425 Review】-Recording the use of CAN communication
【AT-START-F425Review】-RecordingtheuseofCANcommunication CANcommunicationpin Accordingtothechipmanual,AT32F425PB8=CAN_RXPB9=CAN_TXmultiplexedportisMUX4 ChecktheDemoprojectandconfirmt
小火苗 Domestic Chip Exchange
Getting Started with the ST SensorTile.box Sensor Kit (3) Expert Mode Experience
#1IntroductionIntheSensorTile.boxExpertmode,youcanusethevarioussensorinputs,expressions,functions,etc.providedintheSTBLESensorApptosetupanddefinenewapplications/algorithmswithoutprogramming,adesignmethodsimilart
nich20xx ST MEMS Sensor Creative Design Competition
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号