ARM指令及功能描述.doc
《ARM指令及功能描述.doc》由会员分享,可在线阅读,更多相关《ARM指令及功能描述.doc(5页珍藏版)》请在冰点文库上搜索。
![ARM指令及功能描述.doc](https://file1.bingdoc.com/fileroot1/2023-4/28/b54e4aba-7bde-404d-8c69-99e3968b547f/b54e4aba-7bde-404d-8c69-99e3968b547f1.gif)
balancedandrunthesatisfactionofthepeopleeducation.RoomXXCityBureauofeducationalsupervisionofXXmunicipality
May6,2016CountyeconomicinformationandBusinessCouncilSystemCommittee"twolearnado"learningarrangementsspecificprogrammeforadvancefullstrictlyruleparty,accordingtoCountyOrganizationDepartmentonCounty"twolearnado"learningarrangementsofspecificprogrammeandIBoardlearningeducationimplementationprogrammespirit,accordingtodistinguishlevel,andhastargetedsolutionproblemofrequirements,ensurelearningeducationmadeeffectiveness,promoteallmembersconsciouslyrespectedConstitution,andcomplywithpartyrules,withXIGeneralSecretaryseriesimportantspeechspiritarmedmind,andguidepractice,andPromotetheworkandbequalifiedpartymembersandlearningarrangementsareherebymakesthefollowingspecificprogrammes.Learningrequirements,onallpartymemberstostudythepartyConstitutionandpartyrulesandunifytheXIseriesofimportantspeech,GeneralSecretary,speechlearningseriestodeepenunderstandingoftheConstitutionPartyrules,ConstitutionPartyrulesinthedeepinsightseriesaddressthebasicspiritandpracticalrequirements.1.ConstitutionPartyrules.LearningofthepartyConstitution,adeepunderstandingoftheparty'snature,purpose,guidingprinciples,goals,organization,goodstyle,graspconditions,rightsandobligationsofpartymembers,bearinginmindthatoath,clearqualifiedpartymembercriteriaandconditions.Learningthecodeofself-disciplineoftheCPC,theCPC'sdisciplinaryregulations,theChineseCommunistPartyMemberRightsOrdinanceandsoon,masteringself-disciplinestandardsof"fourmust",the"fourupholdings",masteringvarioustypesofdisciplinaryoffenceandpunishmentprovisions.2.seriesspoke.ToXIGeneralSecretaryseriesimportantspeechreading(2016version)andoutpovertyforbasictextbook,learningunderstandXIGeneralSecretaryseriesimportantspeechofbasicspirit,learningunderstandCentralrulingactingpoliticalnewconceptnewthoughtnewstrategyofbasiccontent,learningunderstandXIGeneralSecretaryinFujianworkduringadvocateof"fourgrassroots""immediatelyondo""drop""weakbirdfirstfly"andtheinNanpingresearchstudyproposedof"gravityXiamoved",and"innovationmechanism",importantthought,Masterandstrengthenthepartyspirit,fulfillsthepurposeideas,moralcharacter,conservationrelatedtothebasicrequirements.Mainunderstandmasterfollowingaspectscontent:
(1)idealfaithisCommunistsspiritShangof"calcium",setrightofworldview,andOutlookonlife,andvalues;
(2)Chinadreamisnationalofdream,andnationalofdream,andpeopleofdream,isChinesemodernyilaimostgreatofdream,coreEssentialsisnationalprosperity,andnationalrevitalization,andpeoplehappiness;(3)ChinafeaturesSocialistisachievedChinesegreatrevivalofway,enhancedroadconfidence,andtheoryconfidence,andsystemconfidence;(4)"fourafull"StrategylayoutisnewofhistoryconditionsXiapartyrulingactingpoliticaltotalstrategy,consciouslywith"fourafull"ledthework;(5)insistedinnovation,andcoordination,andgreen,andopen,andshareddevelopmentisrelationshipChinadevelopmentglobalofonedeepchange,accordingtonewdevelopmentconceptdojob;(6)practicelineSocialistcorevalues,promoteSocialistthoughtmoralandChinesetraditionalvirtue
指令格式:
指令{条件}{S}{目的Register},{OP1},{OP2}
"{}"中的内容可选。
即,可以不带条件只有目的寄存器,或
只有目的寄存器和操作数1,也可以同时包含所有选项。
“S”决定指令的操作是否影响CPSR中条件标志位的值,当没有S时指令不更新CPSR中条件标志位的值
助记符
英文全称
示例、功能
跳
转
指
令
B
Branch
BLabel ;程序无条件跳转到标号Label处执行
BL
BranchwithLink
BLLabel;当程序无条件跳转到标号Label处执行时,同时将当前的PC值保存到R14中
BLX
BranchwithLinkandexchange
BLXLabel;从ARM指令集跳转到指令中所指定的目标地址,并将处理器的工作状态有ARM状态切换到Thumb状态,该指令同时将PC的当前内容保存到寄存器R14中
BX
Branchandexchange
BXLabel;跳转到指令中所指定的目标地址,目标地址处的指令既可以是ARM指令,也可以是Thumb指令
数
据
处
理
MOV
Move
MOVR1,R0,LSL#3;将寄存器R0的值左移3位后传送到R1
MVN
MoveNOT
MVNR0,#0;将立即数0取反传送到寄存器R0中,完成后R0=-1
CMP
Compare
CMPR1,R0 ;将寄存器R1的值与寄存器R0的值相减,并根据结果设置CPSR的标志位
CMN
Comparenegative
CMNR1,R0 ;将寄存器R1的值与寄存器R0的值相加,并根据结果设置CPSR的标志位
TST
Test
TST R1,#0xffe ;将寄存器R1的值与立即数0xffe按位与,并根据结果设置CPSR的标志位
TEQ
Testequivalence
TEQ R1,R2 ;将寄存器R1的值与寄存器R2的值按位异或,并根据结果设置CPSR的标志位
ADD
Add
ADDR0,R2,R3,LSL#1 ;R0=R2+(R3<<1)
ADC
Addwithcarry
ADCS R2,R6,R10;R2=R6+R10+!
C,且更新CPSR的进位标志位
SUB
Subtract
SUBR0,R1,#256 ;R0=R1–256
SBC
Subtractwithcarry
SUBSR0,R1,R2;R0=R1-R2-!
C,并根据结果设置CPSR的进位标志位
RSB
Reversesubtract
RSBR0,R1,R2;R0=R2–R1
RSC
Reversesubtractwithcarry
RSCR0,R1,R2 ;R0=R2–R1-!
C
AND
And
ANDR0,R0,#3;该指令保持R0的0、1位,其余位清零。
ORR
OR
ORRR0,R0,#3;该指令设置R0的0、1位,其余位保持不变。
EOR
ExclusiveOR
EORR0,R0,#3;该指令反转R0的0、1位,其余位保持不变。
BIC
Bitclear
BICR0,R0,#0b1011;该指令清除R0中的位0、1、和3,其余的位保持不变。
CLZ
Countleftzero
计算操作数最高端0的个数
乘
加
指
令
MUL
Multiply
MULR0,R1,R2 ;R0=R1×R2
MLA
Multiplyandaccumulate
MLASR0,R1,R2,R3;R0=R1×R2+R3,同时设置CPSR中的相关条件标志位
SMULL
Signedmultiplylong
SMULL R0,R1,R2,R3 ;R0=(R2×R3)的低32位R1=(R2×R3)的高32位
SMLAL
Signedmullandaccumulatel
SMLAL R0,R1,R2,R3 ;R0=(R2×R3)的低32位+R0;R1=(R2×R3)的高32位+R1
UMULL
Unsignedmultiplylong
UMULL R0,R1,R2,R3 ;R0=(R2×R3)的低32位;R1=(R2×R3)的高32位
UMLAL
Unsignedmul&accumulatelon
UMLAL R0,R1,R2,R3 ;R0=(R2×R3)的低位+R0;R1=(R2×R3)的高32位+R1
PSR
访问
MRS
MovePSRtoregister
MRSR0,CPSR;传送CPSR的内容到R0
MSR
MoveregistertoPSR
MSRCPSR_c,R0;传送R0的内容到SPSR,但仅仅修改CPSR中的控制位域
加载/
存储
指令
LDR
Loadword
LDRR0,[R1,R2]!
;将存储器地址为R1+R2的字数据读入R0,并将新地址R1+R2写入R1。
LDRB
Loadbyte
LDRBR0,[R1,#8];将存储器地址为R1+8的字节数据读入R0,并将R0的高24位清零
LDRH
Loadhalfword
LDRHR0,[R1];将存储器地址为R1的半字数据读入寄存器R0,并将R0的高16位清零
LDM
Loadmultiple
LDMFDR13!
,{R0,R4-R12,PC};将堆栈内容恢复到寄存器(R0,R4到R12,LR)
STR
Store
STRR0,[R1],#8;将R0中的字数据写入R1为地址的存储器中,并将新地址R1+8写入R1
STRB
Storebyte
STRBR0,[R1,#8];将寄存器R0中的字节数据写入以R1+8为地址的存储器中
STRH
Storehalfword
STRHR0,[R1,#8];将寄存器R0中的半字数据写入以R1+8为地址的存储器中
STM
Storemultiple
STMFDR13!
,{R0,R4-R12,LR} ;将寄存器列表中的寄存器(R0,R4到R12,LR)存入堆栈
数据
交换
SWP
Swapword
SWPR0,R1,[R2];R2所指的字数据传送到R0,同时R1的数据传送到R2所指的单元
SWPB
Swapbyte
SWPBR0,R1,[R2];R2所指的字节数据传送到R0,R0高24位清零,同时R1低8位送R2所指单元。
移
位
指
令
LSL
Logicshiftleft
MOVR0,R1,LSL#2(ASL#2);将R1中的内容左移两位后传送到R0中,低位用0填充
ASL
Arithmeticshiftleft
LSR
Logicshiftright
MOVR0,R1,LSR#2;将R1中的内容右移两位后传送到R0中,左端用零来填充
ASR
Arithmeticshiftright
MOVR0,R1,ASR#2;将R1中的内容右移两位后传送到R0中,左端用第31位的值来填充
ROR
Rotateright
MOVR0,R1,ROR#2 ;将R1中的内容循环右移两位后传送到R0中
RRX
Rotaterightextended
左端用进位标志位C来填充
协处
理器
CDP
Dataoperations
LDC
Load
STC
Store
MCR
MovetocoprocfrARMreg
MRC
MtoARMregfrcoprocessor
PSRfield
F(Flagsfieldmaskbyte)
S(Statsfieldmaskbyte)
X(Extensionfieldmaskbyte)
C(controlfieldmaskbyte)
CPSR
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
意义
N
Z
C
V
Q
DNZ(RAZ)系统扩展用
I
F
T
M4
M3
M2
M1
M0
CPSR
各位
详细
意义
N
当前指令运算结果为负时,N=1;结果为非负时,N=0
Z
运算结果为0,Z=1;否则Z=0
C
上溢出、进位C=1;下溢出、借位C=0
V
加减法V=1表示符号位溢出
I
I=1时,禁止IRQ中断
F
F=1时,禁止FIQ中断
T
T=0,ARM指令;T=1,Thumb指令
M[4:
0]
0b10000
User
0b10001
FIQ
0b10010
IRQ
0b10011
Supervisor
0b10111
Abort
0b11011
Undefined
0b11111
System
指令
格式
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Cond
Opcode
S
Rn
Rd
Shift_operand
opcode
指令操作符编码
S
决定指令的操作是否影响CPSR的值
Rd
目标寄存器编码
Rn
包含第一个操作数的寄存器编码
Shift_oprand
表示第二个操作数
Cond
指令执行的条件编码,详细如下所示
条
件
域
EQ
Z=1
Equal
NE
Z=0
Notequal,orunordered
CS/HS
C=1
Carryset/Unsignedhigherorsame
Greatthanorequal,orunordered
CC/LO
C=0
Carryclear/Unsignedlower
Lessthan
MI
N=1
Negative
Lessthan
PL
N=0
Positiveorzero
Greaterthanorequal,orunordered
VS
V=1
Overflow
Unordered
VC
V=0
Nooverflow
Notunordered
HI
C=1且Z=0
Unsignedhigher
Greaterthan,orunordered
LS
C=0或Z=1
Unsignedlowerorsame
Lessthanorequal
GE
N=1且V=1或N=0且V=0
Signedgreaterthanorequal
Greaterthanorequal
LT
N=1且V=0或N=0且V=1
Signedlessthan
Lessthan,orunordered
GT
Z=0或N=V
Signedgreaterthan
Greatthan
LE
Z=1或N!
=V
Signedlessthanorequal
Lessthanorequal,orunordered
AL
Always(normallyomitted)
并行
指令
前缀
S
Signedarithmeticmodulo28or216,setsCPSRGEbit
Q
Signedsaturatingarithmetic
SH
Signedarithmetic,halvingresults
U
Unsignedarithmeticmodulo28or216,setsCPSRGEbit
UQ
Unsignedsaturatingarithmetic
UH
Unsignedarithmetic,halvingresults
批量
传输
地址
模式
Blockload/store
Stackpop/push
IA
Incrementafter
FD
Fulldescending
IB
Incrementbefore
ED
Emptydescending
DA
Decrementafter
FA
Fullascending
DB
Decrementbefore
EA
Emptyascending
ARM
指令
寻址
方式
立即寻址
ADD R0,R0,#0x3f
R0←R0+0x3f
寄存器寻址
ADD R0,R1,R2
R0←R1+R2
间接寻址
ADDR0,R1,[R2]
R0←R1+[R2]
变址寻址
LDRR0,[R1,#4]
R0←[R1+4]
LDRR0,[R1,#4]!
R0←[R1+4]、R1←R1+4
LDRR0,[R1],#4
R0←[R1]、R1←R1+4
LDRR0,[R1,R2]
R0←[R1+R2]
多寄存器寻址
LDMIAR0,{R1,R2,R3,R4}
R1←[R0];R2←[R0+4];R3←[R0+8];R4←[R0+12]
伪指令及伪操作
符号
定义
GBLA/LCLA
定义一个全局/局部的数字变量,并初始化为0
GBLL/LCLL
定义一个全局/局部的逻辑变量,并初始化为F(假)
GBLS/LCLS
定义一个全局/局部的字符串变量,并初始化为空
SETA/SETL/SETS
给一个数学/逻辑/字符串变量赋值
RLIST
对一个通用寄存器列表定义名称,访问次序为根据寄存器的编号由低到高,与排列次序无关
数据
定义
DCB(=)/DCW(DCWU)
分配一片连续的字节/半字存储单元并用指定的数据初始化
后缀U表示不要求对齐
DCFS(DCFSU)/DCFD(DCFDU)
分配一片连续的(单/双精度的浮点数)字存储单元并用指定的数据初始化
DCQ(DCQU)/DCD(DCDU)
用于分配一片以双字/字为单位的连续的存储单元并用指定的数据初始化
DCDO
分配字内存但愿,初始化为标号基于静态基址寄存器R9的偏移量
DCI
和D