linux下arm汇编语法(Linux arm assembler syntax)
linux下arm汇编语法(Linux arm assembler syntax)
Linux ARM.Txt assembler syntax opportunities like the bald head hair, you catch caught, catch No. You and I spoke for about 10 minutes, but you did not have any arguments. So, there must be a person become very hypocritical between us! Fault is temporary regret missed forever regret. Encounter is the edge, knowing each other is a contract is love, is love. The first part of the Linux ARM assembler syntax in Linux while using C or C++ programming is very convenient, but the assembly source program system for the most basic initialization, such as initialization stack pointer, set the page table, the operation of ARM co processor. You can jump to the C initialization code is executed after completion. Note that the GNU assembler, follow the AT&T compilation of grammar, available from the GNU site to download the relevant specification ().
A Linux assembly line structure.
Any assembly line is structured as follows:
[]: [} @ comment
[] notes: [} @
Linux ARM assembly, any ends with a colon identifier are considered to be a label, but not necessarily at the beginning of a line.
[1] define a function with "add", the two parameters and returns.
.section.Text, x"
.global add the symbol add external linkage @ give
Add:
ADD R0, R0, R1 @ add input arguments
MOV PC, LR return from @ subroutine
End @ of program
Two. The Linux label in the assembler
Label only by a ~ Z, A ~ Z, 0 ~ 9 "." _ characters etc.. When the label is 0 ~ 9 for local digital label, local label can be repeated, the methods used are as follows:
F: forward in the reference label? Local label
B: back in the reference label? Local label
[2] use cases local symbol example of a cycle
1:
Subs R0, R0, #1 @ r0=r0-1 each time
Bne 1F @ 1 jump to label to execute
The local label represents its address, so it can be used as a variable or function.
Three. Linux segment in the assembler
(1).Section pseudo operation
Users can.Section pseudo operation from the definition of a segment,