arm assembly syntax

Publisher:幸福花开Latest update time:2020-01-02 Source: eefocusKeywords:arm Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    area abc123, code, readonly;

    entry 

    code32



start

    mov r1, #5

    mov r2, #2

    add r0, r1, r2

    end


I installed ADS 1.2; I am a novice and I don't know how to use it. I am not used to it.

It's terrible, there is no keyword syntax highlighting! The above code compiles successfully, except for the instructions such as mov and add, which can be distinguished immediately, who can think of what area is used for?


If I change abc123 to asm, will other newcomers mistakenly think that asm is a keyword?


The problem is that the first three lines and the last line "end" must start with a tab character, which is very annoying for the makefile. I encountered another syntax rule like this;

When programmers learn something, they always have to spend a considerable amount of time getting familiar with the weird and incomprehensible syntax!!!

-------------- When I master a unique skill and unify the syntax of all programming languages, any programmer only needs to learn one universal syntax and can program everywhere;


 

In fact, ARM assembly should be very simple, 37 registers, 53 instruction mnemonics; that's it...

  ARM instruction set: 6 types (53 main mnemonics):

    1. Data processing instructions (22 main mnemonics)

    2. Jump instructions (4 main mnemonics)

    3. Load/Store instructions (16 main mnemonics)

    4. Program Status Register Instructions (2 main mnemonics)

    5. Coprocessor instructions (5 main mnemonics)

    6. Software interrupt instructions (2 main mnemonics)


The registers available in 32-bit mode on ARM 6 (and later) are: 


User26 SVC26 IRQ26 FIQ26 User SVC IRQ ABT UND FIQ


R0 ----- R0 ----- R0 ----- R0 -- -- R0 ----- R0 ----- R0 ----- R0 ----- R0 ----- R1

R1 ----- R1 ----- R1 ----- R1 -- -- R1 ----- R1 ----- R1 ----- R1 ----- R1 ----- R2

R2 ----- R2 ----- R2 ----- R2 -- -- R2 ----- R2 ----- R2 ----- R2 ----- R2 ----- R2

R3 ----- R3 ----- R3 ----- R3 -- -- R3 ----- R3 ----- R3 ----- R3 ----- R3 ----- R3

R4 ----- R4 ----- R4 ----- R4 -- -- R4 ----- R4 ----- R4 ----- R4 ----- R4 ----- R4

R5 ----- R5 ----- R5 ----- R5 -- -- R5 ----- R5 ----- R5 ----- R5 ----- R5 ----- R5

R6 ----- R6 ----- R6 ----- R6 -- -- R6 ----- R6 ----- R6 ----- R6 ----- R6 ----- R6

R7 ----- R7 ----- R7 ----- R7 -- -- R7 ----- R7 ----- R7 ----- R7 ----- R7 ----- R7

R8 ----- R8 ----- R8 R8_fiq R8 ----- R8 ----- R8 ----- R8 ----- R8 R8_fiq

R9 ----- R9 ----- R9 R9_fiq R9 ----- R9 ----- R9 ----- R9 ----- R9 R9_fiq

R10 ---- R10 ---- R10 R10_fiq R10 ---- R10 ---- R10 ---- R10 ---- R10 R10_fiq

R11 ---- R11 ---- R11 R11_fiq R11 ---- R11 ---- R11 ---- R11 ---- R11 R11_fiq

R12 ---- R12 ---- R12 R12_fiq R12 ---- R12 ---- R12 ---- R12 ---- R12 R12_fiq

R13 R13_svc R13_irq R13_fiq R13 R13_svc R13_irq R13_abt R13_und R13_fiq

R14 R14_svc R14_irq R14_fiq R14 R14_svc R14_irq R14_abt R14_und R14_fiq

--------- R15 (PC / PSR) --------- --------------------- R15 (PC) ---------------------

----------------------- CPSR -----------------------

SPSR_svc SPSR_irq SPSR_abt SPSR_und SPSR_fiq


ADC Addition with Carry -  

ADD Addition -  

AND Logical AND -  

ASL Arithmetic Shift Left This is an option, not an instruction.  

ASR Arithmetic Shift Right This is an option, not an instruction.  

B Branch -  

BIC bit clear -  

BL Branch with connection -  

BX branch to Thumb code StrongARM SA1110 ? 

CDP Coprocessor Data Operations -  

CMN compares the negative value -  

CMP Comparison Value -  

EOR Exclusive OR of two values ​​-  

LDC Load memory to coprocessor -  

LDM Load Multiple Registers -  

LDR Load Register -  

LDRB Load byte into register -  

LDRH Load halfword into register StrongARM 

LDRSB Load signed byte into register StrongARM  

LDRSH Load signed halfword into register StrongARM   

LSL Logical Shift Left This is an option, not an instruction. 

LSR Logical Shift Right This is an option, not an instruction. 

MCR Coprocessor Register Transfer - 

MLA Multiplication with Accumulation -  

MOV moves a value/register to a register -  

MRC Coprocessor Register Transfer -  

MRS transfer status flags to a register ARM 6  

MSR transfers the contents of a register to the status flags ARM 6  

MUL Multiplication -  

MVN Transmits a negative value -  

ORR Logical OR -  

ROR Rotate Right This is an option, not an instruction.   

RRX Rotate Right with Extend This is an option, not an instruction.   

RSB Reverse Subtraction -   

RSC Reverse subtraction with borrow -   

SBC Subtraction with Borrow -   

SMLAL Signed long (64-bit) multiply with accumulate StrongARM   

SMULL Signed long (64-bit) multiplication StrongARM   

STC Coprocessor Data Transfer -   

STM stores multiple registers -   

STR stores a register -   

STRB stores a byte (from a register) -   

STRH Store a halfword (from a register) StrongARM   

STRSB Store a signed byte (from a register) StrongARM   

STRSH Store a signed halfword (from a register) StrongARM   

SUB Subtraction -   

SWI causes a software interrupt -   

SWP Swap Register with Memory ARM 3   

TEQ Test Equivalence (Conceptual EOR) -   

TST Test and Screen (conceptual AND) -   

UMLAL Unsigned long (64-bit) multiply with accumulate StrongARM   

UMULL Unsigned long (64-bit) multiplication StrongARM   


Keywords:arm Reference address:arm assembly syntax

Previous article:arm-linux-gcc Common parameters explain how to use the gcc compiler
Next article:ARM bare metal article---boot code analysis

Recommended ReadingLatest update time:2024-11-16 11:44

Embedded ARM virtual development based on Proteus
  1 Introduction   Nowadays, embedded devices exist in every corner of people's lives, such as digital cameras, mobile phones, TV set-top boxes, and PDAs, etc. Most of these embedded devices use 32-bit RISC embedded processors as core components.         Among them, embedded processors based on ARM cores are the bes
[Microcontroller]
Embedded ARM virtual development based on Proteus
ARM2440 for LCD
Change the original 3.5-inch resolution from 240x320 to 480x272 Timing settings: CLKVAL=4 (VCLK =10) 5 VCLK 12 Each dot scanning cycle         VSPW = 10-1 2 tvp - typ:10 Vertical synchronization signal VBPD=2-1 2 tvb - typ: 2 How long does it work after the vertical sync signal LINEVAL=272-1 tvd :272 272 lines VFPD
[Microcontroller]
ARM interrupt processing flow
 
[Microcontroller]
ARM interrupt processing flow
ARM abnormal interrupt and processing process
0. Types of ARM abnormal interrupts ARM supports 7 types of exception interrupts, including reset, undefined instruction exception, soft interrupt exception, prefetch instruction abort, data abort, IRQ, and FIQ. 0.1 Reset (RESET) (Priority = 1)       When the processor reset pin is valid, the system generates a reset
[Microcontroller]
ARM abnormal interrupt and processing process
Application of ARM core board in EEG monitoring TCI injection pump
1.1 Background events When the anesthetic dosage exceeds the standard, it is easy to cause the patient's heart and respiratory arrest, resulting in brain damage. Traditional anesthetic injection relies on the experience of the anesthesiologist, while the new EEG monitoring TCI injection pump combines BIS (EEG monitor
[Medical Electronics]
Application of ARM core board in EEG monitoring TCI injection pump
Analysis and Design of Bootloader in ARM7 Embedded System
1 Introduction As a 16/32-bit high-performance, low-cost, low-power embedded RISC (Reduced Instruction Set Computer) microprocessor, the ARM (Advanced RISC Machines) microprocessor has become the most widely used embedded microprocessor . In embedded system development, the Bootloader is often the first technical diff
[Microcontroller]
ARM bare metal development bootloader code migration from SRAM to DRAM
This section is divided into two parts: 1. ARM boot process 2. Write code 1. 2440: Once powered on, it takes out 4KB of code from Nand and puts it into the stepping stone in SRAM to run and initialize the memory. Then it puts all the code in Nand into the memory. 6410: Once powered on, BL0 in SROM will move
[Microcontroller]
ARM bare metal development bootloader code migration from SRAM to DRAM
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号