浙江工业大学-嵌入式系统原理-实验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

1 / 1
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功