您好,欢迎访问三七文档
第四章1、内存有一个字节变量VAL中存放着小写字符’a’,请将该字符转换为大写字符并在屏幕中显示出来(要求在debug中调试出该程序)。DATASEGMENTVALDB'a'DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVBL,32SUBVAL,BL;变为大写字母MOVDL,VALMOVAH,02H;输出字符INT21HMOVAH,4CHINT21HCODEENDSENDSTART运行结果:2、设存储单元A和B各有一带符号字节数,比较大小和正负,要求将较大数送RES1单元;如果有负数,将一个负数送RES2,否则RES2送-1(要求在debug中调试出该程序)DATASEGMENTADB05HBDB-20HRES1DB?RES2DB?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVBL,ACMPBL,BJGENEXT1MOVAH,BMOVAL,AJMPNEXT2NEXT1:MOVAH,AMOVAL,BNEXT2:CMPAL,0JLNEXT3MOVRES2,-1JMPEXITNEXT3:MOVRES2,ALEXIT:MOVAH,4CHINT21HCODEENDSENDSTART第五章1、在STR到STR+99单元中存放着一个字符串,试编写程序测试该字符串中是否有数字,若有将CL置1,否则CL置0(要求在debug中调试出该程序)。DATASEGMENTSTRDB'abfdeksjfslsjsjsjsjsfjlkasdjflkfafkljkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'CODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,STRMOVCX,100DECSILOOP1:INCSIMOVAL,[SI]CMPAL,30HJAENEXT1LOOPLOOP1NEXT1:CMPAL,39HJNAENEXT2LOOPLOOP1MOVCL,0JMPEXITNEXT2:MOVCL,1EXIT:MOVAH,4CHINT21HCODEENDSENDSTART2、在字节数组中找出第一个负数,并将该负数存入RES单元中;假设该数组中包含20个带符号数,且至少有1个负数(要求在debug中调试出该程序)。DATASEGMENTSTRDB1H,2H,3H,10H,15H,-13H,52H,-34H,42H,72H,-81H,66H,45H,-63H,25H,94H,62H,28H,57H,-54HRESDB?CODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,20MOVSI,-1LOOP1:INCSIMOVBL,STR[SI]CMPBL,0JLNEXT1LOOPLOOP1JMPEXITNEXT1:MOVRES,BLEXIT:MOVAH,4CHINT21HCODEENDSENDSTART第六章1、试编写一个汇编程序,能对键盘输入的小写字母用大写字母显示出来(要求采用子程序格式,即采用子程序完成将小写字母转化成大写字母)。DATASEGMENTRESDB?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXCALLSTRSTRPROCNEARMOVAH,01INT21HMOVRES,ALSUBRES,32MOVDL,RESMOVAH,02INT21HMOVAH,4CHINT21HCODEENDSENDSTART2、有2个数组:ary1db12,-35,0,126,-90,-5,68,120,1,-19ary2db24,25,0,-38,-89,99,68,100,2,-20比较两个数组的对应位,将大的数放在ary1数组中,小的数放在ary2中(要求采用子程序格式)DATASEGMENTARY1DB12,-35,0,126,-90,-5,68,120,1,-19ARY2DB24,25,0,-38,-89,99,68,100,2,-20ARY3DB10DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,ARY1LEADI,ARY2LEABX,ARY3MOVCX,10DECSIDECDIDECBXLOOP1:INCSIINCDIINCBXCALLSTRLOOPLOOP1STRPROCNEARMOVAL,[DI]CMP[SI],ALJLNEXT1JMPNEXT2NEXT1:MOV[BX],ALMOVAH,[SI]MOV[DI],AHMOV[SI],ALNEXT2:RETSTRENDPMOVAH,4CHINT21HCODEENDSENDSTART第七章用DOS的10号功能调用输入一个字符串,并用DOS的9号功能调用将这个字符串输出到屏幕上显示。DATASEGMENTMAXLENDB20,0,20DUP('$')DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDX,OFFSETMAXLENMOVAH,0AHINT21HMOVDX,OFFSETMAXLEN+2MOVAH,09HINT21HMOVAH,4CHINT21HCODEENDSENDSTART
本文标题:微机作业
链接地址:https://www.777doc.com/doc-6380694 .html