您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 工程监理 > 浙江工业大学-嵌入式系统原理-实验4
嵌入式系统实验四4.1#includestdio.hexternintstrcmp(char*d,char*s);intmain(){intresult;char*str1=contentofstring1;char*str2=contentofstring2;printf(%s\n,str1);printf(%s\n,str2);result=strcmp(str1,str2);printf(%d\n,result);return(0);}AREASCopy,CODE,READONLYGLOBALstrcmpstrcmpMOVR4,#1LELDRBR2,[R0],#1LDRBR3,[R1],#1CMPR2,R3MOVNER4,#0CMPR2,#0BNELEMOVR0,R4MOVPC,LREND4.2#includestdio.hexternvoidstrscopy(char*d,char*s);intmain(){char*str1=HelloZhejiangUniversityofTechnology;char*str2;strscopy(str2,str1);printf(%s\n,str1);printf(%s\n,str2);return(0);}AREASCopy,CODE,READONLYGLOBALstrscopystrscopyLELDRBR2,[R1],#1STRBR2,[R0],#1CMPR2,#0BNELEMOVPC,LREND4.3intadd1(inta,intb,intc,intd,inte,intf){intsum;sum=a+b+c+d+e+f;returnsum;}AREASCopy,CODE,READONLYGLOBALstrscmpIMPORTadd1ENTRYCODE32strscmpMOVR0,#2ADDR1,R0,R0ADDR2,R1,R0ADDR3,R1,R2ADDR3,R3,R0STRR3,[SP,#-4]!ADDR3,R1,R2STRR3,[SP,#-4]!ADDR3,R2,R0BLadd1MOVR8,R0END
本文标题:浙江工业大学-嵌入式系统原理-实验4
链接地址:https://www.777doc.com/doc-7248871 .html