您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 汇编语言程序设计——顺序结构
1.编写十六进制数的乘法程序。要求从键盘上输入两个一位十六进制数据,成绩存入SUM单元SSEGSEGMENTSTACKSTKDB20DUP(0)SSEGENDSDSEGSEGMENTSUMDB?HTABDB'0123456789ABCDEF'DSEGENDSCSEGSEGMENTASSUMECS:CSEG,DS:DSEGASSUMEES:DSEG,SS:SSEGSTART:MOVAX,DSEGMOVDS,AXMOVES,AXMOVAX,SSEGMOVSS,AXMOVSP,LENGTHSTKMOVAH,01HINT21HSUBAL,30HMOVCH,ALMOVDL,'*'MOVAH,02HINT21HMOVAH,01HINT21HSUBAL,30HMULCHMOVSUM,ALMOVCH,ALMOVDL,'='MOVAH,02HINT21HMOVAL,CHMOVCL,4SHRAL,CLLEABX,HTABXLATMOVDL,ALMOVAH,02HINT21HANDCH,0FHMOVAL,CHXLATMOVDL,ALMOVAH,02HINT21HMOVDL,'H'MOVAH,02HINT21HMOVAH,4CHINT21HCSEGENDSENDSTART2.编写程序,求表达式5X+Y的值,要求:X,Y值从键盘输入,X,Y均为一位十六进制数据,将计算结果存入SUM单元SSEGSEGMENTSTACKSTKDB20DUP(0)SSEGENDSDSEGSEGMENTSUMDB?HTABDB30H,31H,32H,33H,34H,35H,36H,37H,38H,39HDB41H,42H,43H,44H,45H,46HDSEGENDSCSEGSEGMENTASSUMECS:CSEG,DS:DSEGASSUMESS:SSEGSTART:MOVAX,DSEGMOVDS,AXMOVAX,SSEGMOVSS,AXMOVSP,LENGTHSTKMOVDL,'5'MOVAH,02HINT21HMOVDL,'*'MOVAH,02HINT21HMOVAH,01HINT21HMOVBL,05MULBLMOVCH,ALMOVDL,'+'MOVAH,02HINT21HMOVAH,01HINT21HADDCH,ALMOVSUM,CHMOVDL,'='MOVAH,02HINT21HSUBCH,20HMOVAL,CHMOVCL,4SHRAL,CLLEABX,HTABXLATMOVDL,ALMOVAH,02HINT21HMOVAL,CHANDAL,0FHLEABX,HTABXLATMOVDL,ALMOVAH,02HINT21HMOVDL,'H'MOVAH,02HINT21HMOVAH,4CHINT21HCSEGENDSENDSTART3.编写程序,求表达式Y=AX^2+BX+C的值,已知A,B,C的值分别存放在DATAA,DATAB和DATAC字节单元中,X的值存放在DATAX字节单元中,计算结果存入DATAY字节单元。要求在DEBUG下多次修改X的值,观察计算结果。SSEGSEGMENTSTACKSTKDB20DUP(0):不确定对错SSEGENDSDSEGSEGMENTDATAADB31HDATABDB32HDATACDB33HDATAXDB?DATAYDB?DSEGENDSCSEGSEGMENTASSUMECS:CSEG,DS:DSEGASSUMESS:SSEGSTART:MOVAX,DSEGMOVDS,AXMOVAX,SSEGMOVSS,AXMOVSP,LENGTHSTKMOVBL,DATAAMOVBH,00HMOVAH,01H:输入第一个数INT21HSUBAL,30HMOVDATAX,ALMULALMULBXADDBL,ALMOVSUM,BL:结果存入SUM单元MOVAH,4CHMOVAL,0INT21HCSEGENDSENDSTART4.从键盘上输入0-9之间的任意一个数字,利用查表的方法,计算其平方值,并将结果以十进制形式在屏幕上显示出来。SSEGSEGMENTSTACKSTKDB20DUP(0)SSEGENDSDSEGSEGMENTHEXDW?DSEGENDSCSEGSEGMENTASSUMECS:CSEG,DS:DSEGASSUMESS:SSEGSTART:MOVAX,DSEGMOVDS,AXMOVAX,SSEGMOVSS,AXMOVSP,LENGTHSTKMOVAH,01H:输入第一个数INT21HSUBAL,30HMULALMOVDL,AXMOVAH,02HINT21HCSEGENDSENDSTART5.利用查表的方法,计算X^2+y^2的值(0=X,0=Y=15),X、Y分别存放在DAX和DAY单元中,计算结果存入SUM单元。
本文标题:汇编语言程序设计——顺序结构
链接地址:https://www.777doc.com/doc-4712010 .html