资源描述:
《高级体系结构实验报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.提交三个程序的mips汇编代码文件以及X86汇编代码文件;MIPS1.test.c:.frame$sp,16,$31.setnoreorder・cpload$25・setreorderaddu$sp,$sp,-16.mask0x40c00000,-8SW$22,0($sp)sw$23,4($sp)sw$30,8($sp)la$30,3la$23,2addu$22,$30,$23subu$22,$30,$23mul$22,$30,$23div$22,$30,$23rem$22,$30,$23move$2,$0L.l:lw$22,0($sp)lw$23,4($sp)lw$30,&$sp)
2、addu$sp,$sp,16j$312.sum.c.frame$sp,16,$31.setnoreorder.cpload$25.setreorderaddu$sp,$sp,-16.mask0x40800000,-12sw$23,0($sp)sw$30,4($sp)move$30,$0move$23,$0move$30,$0L.2:addu$23,$23,$30L.3:la$304($30)la$24,100ble$30,$24丄.2move$2,$0L.l:lw$23,0($sp)lw$30,4($sp)addu$sp,$sp,16j$311.func.c.frame$sp,0,$31
3、.setnoreorder.cpload$25.setreorderaddu$2,$4,$5L.l:j$31.endadd.globlmain.text.align2.entmainmain:.frame$sp,48,$31.setnoreorder.cpload$25.setreorderaddu$sp,$sp,-48.mask0x82000000,-28.cprestore16sw$31/20($sp)la$24,1sw$24,-4+48($sp)la$24,2sw$24,・8+48($sp)lw$4,-4+48($sp)lw$5,-8+4&$sp)jaladdsw$2,-12+48
4、($sp)move$2,$0L.2:lw$2546($sp)lw$31,20($sp)addu$sp,$sp,48j$31X86汇编Sum.c#includeviostream>usingnamespacestd;intmain()012D1370012D1371012D1373pushebpmovebp,espsubesp,0D8h012D1379012D137A012D137B012D137C012D1382012D1387pushebxpushesipushedileaedi,[ebp-0D8h]ecx,36heax,OCCCCCCCChmovmovO12D138Crepstosd
5、wordptres:[edi]i=0;O12D138Emovdwordptr[i],0sum=0;012D1395movdwordptr[sum],0for(i=0;i<=100;i++)012D139C012D13A3012D13A5012D13A8O12D13ABO12D13AEO12D13B2movdwordptr[i],0jmpmain+3Eh(12D13AEh)moveax,dwordptr[i]addeax,lmovdwordptr[i],eaxcmpdwordptr[i],64hjgmain+4Fh(12D13BFh)012D13B4O12D13B7O12D13BAsum+
6、=i;moveax,dwordptr[sum]addeax,dwordptr[i]movdwordptr[sum],eax}012D13BDreturn0;012D13BF}jmpxoreax,eaxmain+35h(12D13A5h)012D13C1012D13C2012D13C3012D13C4012D13C6012D13C7retFun.cintmain(){009D13E0009D13E1009D13E3009D13E9009D13EA009D13EB009D13EC009D13F2009D13F7009D13FCinta=l;009D13FEintb=2;009D1405int
7、c;c=add(a,b);009D140C009D140F009D1410009D1413009D1414009D1419009D141Creturn0;009D141F}009D1421009D1422009D1423009D1424009D142A009D142C009D1431009D1433popedipopesipopebxmovesp,ebppopebppushebpmovebp,espsubesp,0E4hpusheb