您好,欢迎访问三七文档
要求在附加段中,建立一个按从小到大的顺序排列的无符号数数组(长度为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
本文标题:要求在附加段中
链接地址:https://www.777doc.com/doc-5728938 .html