文档介绍:ARM程序示例————————————————————————————————作者:————————————————————————————————日期: EXAMPLE1(AboutLDR、)AREALoadcon,CODE,READONLYENTRY;MarkfirstinstructiontoexecutestartBLfunc1;BranchtofirstsubroutineBLfunc2;BranchtosecondsubroutinestopMOVr0,#0x18;angel_SWIreason_ReportExceptionLDRr1,=0x20026;ADP_Stopped_ApplicationExitSWI0x123456;ARMsemihostingSWIfunc1LDRr0,=42;=>MOVR0,#42LDRr1,=0x55555555;=>LDRR1,[PC,#offsetto;LiteralPool1]LDRr2,=0xFFFFFFFF;=>MVNR2,#0MOVpc,;LiteralPool1contains;literalOx55555555func2LDRr3,=0x55555555;=>LDRR3,[PC,#offsetto;LiteralPool1];LDRr4,=0x66666666;mentedit;fails,becauseLiteralPool2;isoutofreachMOVpc,lrLargeTableSPACE4200;Startingatthecurrentlocation,;clearsa4200byteareaofmemory;tozeroEND;LiteralPool2isemptyTheLDRpseudo-onstant:iftheconstantcanbeconstructedwithaMOVorMVNinstruction,,theassembler:placesthevalueinaliteralpool(aportionofmemoryembeddedinthecodetoholdconstantvalues)generatesanLDRinstructionwithaprogram-:LDRrn,[pc,#offsettoliteralpool];loadregisternwithoneword;fromtheaddress[pc+offset]:lessthan4KBinARMstate,,=constpseudo-instructionrequirestheconstanttobeplacedinaliteralpool,theassembler:,,-instruction,andwithin4KB(ARM)or1KB(Thumb).(ADRADRL)AREAadrlabel,CODE,READONLYENTRY;Markfirstinstru