要求在附加段中

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

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

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

资源描述

要求在附加段中,建立一个按从小到大的顺序排列的无符号数数组(长度为10),从键盘输入一个无符号数,并进行查找,如果查到则将该数和该数在数组中的位置输出到显示器上,如果没有查找到,则输出提示信息。(汇编语言编写)datasegsegmentmess1db'PleaseInputYourNo.',13,10,'$'mess2db'YourNumberisnotfinded!',13,10,'$'mess3db'Yes!',13,10,'$'mess4db'wronginput!',13,10,'$'lowindexdw?Highindexdw?DataTallabelworddataaddrdw1,2,3,4,5,6,7,8,20,30datasegendscodesegsegmentassumeds:dataseg,cs:codesegmainprocfarstart:movax,datasegmovds,axleasi,dataaddrmovlowindex,0movhighindex,9leadx,mess1movah,09hint21hmovah,01int21hsubal,30hmovdl,10muldlmovbl,almovah,01int21hsubal,30haddal,blsubah,ahcmpax,[si]jleloop1cmpax,[si+18]jgeloop4next1:movcx,lowindexmovbp,highindexaddcx,bpshrcx,1movbp,cxshlbp,1cmpax,[si+bp]jlloop2jgloop3jmpoutput1loop4:cmpax,[si+18]jgnextjmpoutput2output2:leadx,mess3movah,09hint21hmovdx,31hmovah,02hint21hmovdx,30hmovah,02hint21hmovax,4c00hint21hloop3:addcx,1movlowindex,cxjmpnext1loop2:subcx,1movhighindex,cxjmpnext1loop1:cmpax,[si]jnznextjmpoutputoutput1:leadx,mess3movah,09hint21hmovdx,cxadddl,31hmovah,02hint21hmovax,4c00hint21hnext:leadx,mess2movah,09hint21hmovax,4c00hint21houtput:leadx,mess3movah,09hint21hmovdx,1adddx,30hmovah,02hint21hmovax,4c00hint21hmainendpcodesegendsendstart

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

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

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

×
保存成功