ARM 学习笔记之17:Uppercase or lowercase when writing assembly language source code

博客介绍了ARM指令编写规范,指令助记符、伪指令、指令和符号寄存器名(除A32或T32指令中的a1 - a4和v1 - v8)需全大写或全小写,标签和注释大小写不限。还提及许多核心寄存器有同义词,除特定寄存器外,寄存器名可全大写或全小写。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

You must write instruction mnemonics, pseudo-instructions, directives, and symbolic register names
(except a1-a4 and v1-v8 in A32 or T32 instructions) in either all uppercase or all lowercase. You must
not use mixed case. Labels and comments can be in uppercase, lowercase, or mixed case.

                AREA     A32ex,     CODE,     READONLY
                                                                  ; Name this block of code A32ex
                ENTRY                                     ; Mark first instruction to execute
start
               MOV   r0,   #10                         ; Set up parameters
               MOV   r1,   #3
               ADD   r0,   r0,   r1                      ; r0 = r0 + r1
stop
              MOV   r0,   #0x18                       ; angel_SWIreason_ReportException
              LDR   r1,   =0x20026                 ; ADP_Stopped_ApplicationExit
              SVC   #0x123456                     ; AArch32 semihosting (formerly SWI)
              END                                            ; Mark end of file
 

--------------------------------------------------------------------------------------------------------------------------------------------------

Many of the core register names have synonyms. The following table shows the predeclared core registers:

Register namesMeaning
r0-r15 and R0-R15General purpose registers.
a1-a4Argument, result or scratch registers. These are synonyms for R0 to R3.
v1-v8Variable registers. These are synonyms for R4 to R11.
SBStatic base register. This is a synonym for R9.
IPIntra-procedure call scratch register. This is a synonym for R12.
SPStack pointer. This is a synonym for R13.
LRLink register. This is a synonym for R14.
PCProgram counter. This is a synonym for R15.

                                              Table 3-2 Predeclared core registers in AArch32 state


With the exception of a1-a4 and v1-v8, you can write the register names either in all upper case or all lower case.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值