资源描述:
《实验四循环结构程序设9计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、卖验叨循环结构程序设计一、实验目的理解单重循环与多重循环程序的结构及执行过程;掌握循环控制指令的用法,会使用数据串操作指令编程;熟练掌握循环结构程序的设计方法和利用设置断点调试程序的方法。二、示例1、单循环程序已知当前数据段中DADT1和DADT2开始分别存放若干字节数据,数据个数相同,编制程序检查两数据块中数据是否相同,若相同,则在屏幕上显示1,否则显示0。【参考程序如下】DSEGSEGMENTDATA1DB'ABCDEFG3'DATA2DB'ABCDEF3G'CNTDW8DSEGENDSCSEGSEG
2、MENTASSUMECS:CSEG,DS:DSEGSTART:MOVAX,DSEGMOVDS,AXMOVDL,31HLEASI,DATA1LEADI,DATA2MOVCX,CNTDECSTDECDIAGAIN:INCSIINCDIMOVAL,[SI]CMPAL,[DI]LOOP/AGATNJZDTSPDECDLD1SP:MOVAH,2INI21HMOVAH,4CH1NT21HCSEGENDSENDSTART三、实验题课外实验内容:教材习题5.19oDATASSEGMENT;此处输入数据段代码arrayAd
3、w1,2,3,4,5,6,7,8,9,10,11,12,13,14,15arrayBdw2,4,6,44,16,1&8,16,25,24,13,47,48,49,50,87,36,35,34,38arrayCdw15dup(?)DATASENDSSTACKSSEGMENT;此处输入堆栈段代码STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;此处输入代码据段代码moves,axsubdi,disu
4、bsi,sisubbx,bxmovdx,15loopl:leadi,arrayBmovax,arrayA[si]movex,20cldrepnescaswjnzcontinuemovarrayC[bx],axaddbx,2continuc:decdxaddsi,2cmpdx,0jnelooplMOVAH,4CHTNT21HCODESENDSENDSTART-p=0AX=1442BX=0000DS=1432ES=14321449:00038ED8-pflX=1442BX=0000DS=1442ES=1432
5、1449:00058EC0CX=00A4DX=0000SP=0000SS=1U2CS=1449IP=0003MOVDSfXCX=00A4DX=0000SP=0000SS=1442CS=1U9IP詡005MOVES,AXBP=0000SI=0000DI=0000NVUPElPLNZNAPONCBP=0000SI=0000DI=0000NVUPElPLNZNAPONCrpRX=1442BX=0000DS=1U2ES=14421449:00072BFFCX=00A4DX=0000SP=0000SS=1442CS
6、=1U9IP=0007SUBDI,DIBP=0000SI=0000DI=0000NVUPElPLNZNAPONC_【)AX=U42BX=0000DS=1U2ES=14421449:00092BF6-pAX=1442BX=0000DS=1442ES=14421449:000B2BDBCX=00A4DX=0000SP=0000SS=1442CS=1449IP=0009SUBSI,SICX=00A4DX=0000SP=0000SS=1442CS=1449IP=000BSUBBX,BXBP=0000SI=0000
7、DI=0000NVUPElPLZRNAPENCBP=0000SI=0000DI=0000NVUPElPLZRNfiPENCAX=1442BX=0000DS=1442ES=14421449:0000BR0F00—PCX=00fl4DX=0000SP=0000SS=1442CS=U49IP=000DMOVDX,000FBP=0O00SI=0000DI=0000NVUPElPLZRNAPENCfiX=1442BX=0000DS=1442ES=14421449:00108D3E1E00HpCX=00A4DX=00
8、OFSP=0000SS=1442CS=1449IP=0010LEADIJ001EJBP=0000SI=0000DI=0000NVUPElPLZRNAPENCDS:001E=0002fiX=lU2BX=0000CX=00A4DX=000FSP=0000DS=1442ES=1442SS=1442CS=1449IP=00141U9:00U8B840000MOVAXJSI-00001-pBP=0000SI=0000DI=001ENVU