资源描述:
《arm实验汇编代码.》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、AREAExample1,CODE,READONLYENTRYCODE32STARTMOVR0,#15MOVR1,#8ADDSR0,R0,R1BSTARTENDTest2.sXEQU11YEQU8BIT23EQU(1<<23AREAExample3,CODE,READONLYENTRYCODE32STARTYMOVR0,#XMORR1,#YADDR3,R0,R1MOVR8,R3MVNR0,#0XA0000007SUBR5,R0,R8,LSL#3MOVR0,#YADDR0,R0,R0,LSL#2MO
2、VR0,R0,LSR#1MOVR1,#XMOVR1,R1,LSL#1CMPR0,R1LDRHIR2,=0XFFFF0000ANDHIR5,R5,R2ORRLSR5,R5,#0X000000FFTSTR5,#BIT32BICNER5,R5,#0X00000040BSTARTEND//*******Test3.s********************XEQU11YEQU8BIT23EQU(1<<23AREAExample3,CODE,READONLYENTRYCODE32STARTMOVR0,#XM
3、OVR1,#YADDR3,R0,R1MOVR8,R3MVNR0,#0XA0000007SUBR5,R0,R8,LSL#3MOVR0,#YADDR0,R0,R0,LSL#2MOVR0,R0,LSR#1MOVR1,#XMOVR1,R1,LSL#1CMPR0,R1LDRHIR2,=0XFFFF0000ANDHIR5,R5,R2ORRLSR5,R5,#0X000000FFTSTR5,#BIT23BICNER5,R5,#0X00000040BSTARTEND//*************Test4.s***
4、************;**************************************;Name:test4.s;Function:CaculateX^n;Entranceparametre:;Outparametre:R0Result;Sourceoccupation:R0,R1;Explanation:;**************************************XEQU9nEQU8AREAExample4,CODE,READONLYENTRYCODE32STA
5、RTLDRSP,=0X40D03F0DLDRR0,=XLDRR1,=nBLPOWHALTBHALT;**************************************;Name:POW;Function:zhengshuchengfang;Entranceparametre:;Outparametre:;Sourceoccupation:R0,R1;Explanation:Thiscodedoesntcarethenumberoverflow;**********************
6、****************POWSTMFDSP!,{R1-R12,LR}MOVSR2,R1MOVEQR0,#1BEQPOW_ENDCMPR2,#1BEQPOW_ENDMOVR1,R0SUBR2,R2,#1POW_L1BLDO_MULSUBSR2,R2,#1BNEPOW_L1POW_ENDLDMFDSP!,{R1-R12,PC};**************************************;Name:DO_MUL;Function:MULTIPLEOF32BITDATA;Ent
7、ranceparametre:R0CHENGSHU;R1BEICHENGSU;Outparametre:R0Result;Sourceoccupation:R0,R1;Explanation:;**************************************DO_MULMULR0,R1,R0MOVPC,LREND//***********Test5.s***************;**************************************;Name:test5.s;
8、Function:Caculate1+2+3+…+N;Entranceparametre:;Outparametre:;Sourceoccupation:;Explanation:N>=0,ifN=0reult=0,ifN=1resualt=1;**************************************NEQU100AREAExample5,CODE,READONLYENTRYCODE32ARM_CODELDRSP,=0X40003F00;Thereshouldb