南邮微机原理试验一二

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1.1程序修改.486DATASEGMENTUSE16SUMDB?,?MESGDB'25+9='DB0,0,'$'N1DB9,0F0HN2DB25DATAENDSCODESEGMENTUSE16ASSUMECS:CODE,DS:DATABEG:MOVAX,DATAMOVDS,AXMOVBX,OFFSETSUMMOVAH,N1MOVAL,N2ADDAH,ALMOV[BX],AHCALLCHANGMOVAH,9MOVDX,OFFSETMESGINT21HMOVAH,4CHINT21HCHANGPROCLAST:CMPBYTEPTR[BX],10JCNEXTSUBBYTEPTR[BX],10INCBYTEPTR[BX+7]MOVAH,BYTEPTR[BX]JMPLASTNEXT:MOVDX,WORDPTRSUMADD[BX+8],DXADDBYTEPTR[BX+7],30HADDBYTEPTR[BX+8],30HRETCHANGENDPCODEENDSENDBEG2.3.4从数据段NUM单元开始存有9个有符号数,并编写一个程序实现:找出最小值存放到数据段MIN单元,并将负数的个数以十进制的形式显示在屏幕上。.486DATASEGMENTUSE16NUMDB-8,-44,-88,-37,2,-1,8,-26,-18MINDB?ABDB'0'DATAENDSCODESEGMENTUSE16ASSUMECS:CODE,DS:DATABEG:MOVAX,DATAMOVDS,AXMOVBX,OFFSETNUMMOVCH,0MOVCL,9AGAIN:CMPBYTEPTR[BX],0JGNEXT1INCABCMPBYTEPTR[BX],CHJGNEXT1MOVCH,BYTEPTR[BX]NEXT1:INCBYTEPTRBXDECCLJNEAGAINMOVMIN,CHMOVAH,2MOVDL,ABINT21HMOVAH,4CHINT21HCODEENDSENDBEG.486DATASEGMENTUSE16BUF1DB'123456'BUF2DB'000000'BUF3DB'Pleaseinputcommunicationwords:',0DH,0AH,'$'BUF4DB3OUT1DB'ERRORS',0DH,0AH,'$'OUT2DB'RIGHT',0DH,0AH,'$'OUT3DB'*','$'OUT4DB0DH,0AH,'$'DATAENDSCODESEGMENTUSE16ASSUMECS:CODE,DS:DATA,ES:DATABEG:MOVAX,DATAMOVDS,AXMOVES,AXMOVAH,00HMOVAL,3INT10HLAST1:LEASI,BUF1LEADI,BUF2MOVBX,OFFSETBUF2MOVCX,6MOVAH,09HLEADX,BUF3INT21HLAST:MOVAH,07HINT21HMOVBYTEPTR[BX],ALINCBXMOVAH,09HMOVDX,OFFSETOUT3INT21HLOOPLASTMOVAH,09HLEADX,OUT4INT21HMOVCX,6CLDREPECMPSBJZEXITMOVAH,09HLEADX,OUT1INT21HDECBUF4JZLAST2JMPLAST1EXIT:MOVAH,09HLEADX,OUT2INT21HLAST2:MOVAH,4CHINT21HCODEENDSENDBEG

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

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

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

×
保存成功