编写程序计算(A+B*10-D)/C,其中A、B、C、D均为已定义的有符号双字变量,要求商和余数分别存入变量X和Y中
来源:学生作业帮 编辑:神马作文网作业帮 分类:数学作业 时间:2024/11/12 00:08:15
编写程序计算(A+B*10-D)/C,其中A、B、C、D均为已定义的有符号双字变量,要求商和余数分别存入变量X和Y中
用汇编语言编写
用汇编语言编写
DATA SEGMENT
A1\x05DW\x0510\x05;双字变量A的低16位
A2\x05DW\x050\x05;双字变量A的高16位
B1\x05DW\x0510\x05;双字变量B的低16位
B2\x05DW\x050\x05;双字变量B的高16位
C\x05DW\x053
D1\x05DW\x0510\x05;双字变量D的低16位
D2\x05DW\x050\x05;双字变量D的高16位
X\x05DW\x050
Y\x05DW\x050
Z\x05DW\x0510
M\x05DB\x051 DUP('X')
N\x05DB\x051 DUP('Y')
K\x05DB\x051 DUP('=')
STR\x05DB 16 DUP(?)
DATA\x05ENDS
STACK\x05SEGMENT\x05STACK
\x05DB\x05200\x05DUP(0)
STACK\x05ENDS
CODE\x05SEGMENT
\x05ASSUME DS:DATA,SS:STACK,CS:CODE
START:\x05MOV\x05AX,DATA
\x05MOV\x05DS,AX
\x05MOV\x05AX,B1
\x05IMUL\x05Z
\x05MOV\x05CX,AX
\x05MOV\x05BX,DX
\x05MOV\x05AX,B2
\x05IMUL\x05Z
\x05ADD\x05BX,AX
\x05MOV\x05AX,A1
\x05MOV\x05DX,A2
\x05ADD\x05CX,AX
\x05ADC\x05BX,DX
\x05MOV\x05AX,D1
\x05MOV\x05DX,D2
\x05SUB\x05CX,AX
\x05SBB\x05BX,DX
\x05MOV\x05AX,CX
\x05MOV\x05DX,BX
\x05IDIV\x05C
\x05MOV\x05X,AX
\x05MOV\x05Y,DX
\x05LEA\x05DI,STR
\x05MOV\x05BYTE\x05PTR [DI],'X'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'='
\x05INC \x05DI
\x05MOV\x05AX,X
\x05MOV\x05CL,4
\x05SHR\x05AH,CL
\x05OR\x05AH,30H
\x05
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW1\x05
\x05ADD\x05AH,07H
BELOW1:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,X
\x05AND\x05AH,0FH
\x05OR\x05AH,30H
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW2\x05
\x05ADD\x05AH,07H
BELOW2:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05
\x05
\x05MOV\x05AX,X
\x05MOV\x05CL,4
\x05SHR\x05AL,CL
\x05OR\x05AL,30H
\x05
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW3\x05
\x05ADD\x05AL,07H
BELOW3:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05AX,X
\x05AND\x05AL,0FH
\x05OR\x05AL,30H
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW4\x05
\x05ADD\x05AL,07H
BELOW4:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'H'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],','
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'Y'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'='
\x05INC \x05DI
\x05MOV\x05AX,Y
\x05MOV\x05CL,4
\x05SHR\x05AH,CL
\x05OR\x05AH,30H
\x05
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW5\x05
\x05ADD\x05AH,07H
BELOW5:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05AND\x05AH,0FH
\x05OR\x05AH,30H
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW6\x05
\x05ADD\x05AH,07H
BELOW6:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05MOV\x05CL,4
\x05SHR\x05AL,CL
\x05OR\x05AL,30H
\x05
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW7\x05
\x05ADD\x05AL,07H
BELOW7:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05AND\x05AL,0FH
\x05OR\x05AL,30H
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW8\x05
\x05ADD\x05AL,07H
BELOW8:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05
\x05
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'H'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'$'
\x05LEA\x05DX,STR
\x05MOV\x05AH,9
\x05INT\x0521H
\x05MOV\x05AH,4CH
\x05INT\x0521H
CODE\x05ENDS
\x05END START
A1\x05DW\x0510\x05;双字变量A的低16位
A2\x05DW\x050\x05;双字变量A的高16位
B1\x05DW\x0510\x05;双字变量B的低16位
B2\x05DW\x050\x05;双字变量B的高16位
C\x05DW\x053
D1\x05DW\x0510\x05;双字变量D的低16位
D2\x05DW\x050\x05;双字变量D的高16位
X\x05DW\x050
Y\x05DW\x050
Z\x05DW\x0510
M\x05DB\x051 DUP('X')
N\x05DB\x051 DUP('Y')
K\x05DB\x051 DUP('=')
STR\x05DB 16 DUP(?)
DATA\x05ENDS
STACK\x05SEGMENT\x05STACK
\x05DB\x05200\x05DUP(0)
STACK\x05ENDS
CODE\x05SEGMENT
\x05ASSUME DS:DATA,SS:STACK,CS:CODE
START:\x05MOV\x05AX,DATA
\x05MOV\x05DS,AX
\x05MOV\x05AX,B1
\x05IMUL\x05Z
\x05MOV\x05CX,AX
\x05MOV\x05BX,DX
\x05MOV\x05AX,B2
\x05IMUL\x05Z
\x05ADD\x05BX,AX
\x05MOV\x05AX,A1
\x05MOV\x05DX,A2
\x05ADD\x05CX,AX
\x05ADC\x05BX,DX
\x05MOV\x05AX,D1
\x05MOV\x05DX,D2
\x05SUB\x05CX,AX
\x05SBB\x05BX,DX
\x05MOV\x05AX,CX
\x05MOV\x05DX,BX
\x05IDIV\x05C
\x05MOV\x05X,AX
\x05MOV\x05Y,DX
\x05LEA\x05DI,STR
\x05MOV\x05BYTE\x05PTR [DI],'X'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'='
\x05INC \x05DI
\x05MOV\x05AX,X
\x05MOV\x05CL,4
\x05SHR\x05AH,CL
\x05OR\x05AH,30H
\x05
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW1\x05
\x05ADD\x05AH,07H
BELOW1:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,X
\x05AND\x05AH,0FH
\x05OR\x05AH,30H
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW2\x05
\x05ADD\x05AH,07H
BELOW2:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05
\x05
\x05MOV\x05AX,X
\x05MOV\x05CL,4
\x05SHR\x05AL,CL
\x05OR\x05AL,30H
\x05
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW3\x05
\x05ADD\x05AL,07H
BELOW3:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05AX,X
\x05AND\x05AL,0FH
\x05OR\x05AL,30H
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW4\x05
\x05ADD\x05AL,07H
BELOW4:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'H'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],','
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'Y'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'='
\x05INC \x05DI
\x05MOV\x05AX,Y
\x05MOV\x05CL,4
\x05SHR\x05AH,CL
\x05OR\x05AH,30H
\x05
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW5\x05
\x05ADD\x05AH,07H
BELOW5:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05AND\x05AH,0FH
\x05OR\x05AH,30H
\x05CMP\x05AH,3Ah\x05
\x05JB\x05BELOW6\x05
\x05ADD\x05AH,07H
BELOW6:\x05ADD\x05AH,00H
\x05
\x05MOV\x05[DI],AH
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05MOV\x05CL,4
\x05SHR\x05AL,CL
\x05OR\x05AL,30H
\x05
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW7\x05
\x05ADD\x05AL,07H
BELOW7:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05INC\x05DI
\x05MOV\x05AX,Y
\x05AND\x05AL,0FH
\x05OR\x05AL,30H
\x05CMP\x05AL,3Ah\x05
\x05JB\x05BELOW8\x05
\x05ADD\x05AL,07H
BELOW8:\x05ADD\x05AL,00H
\x05
\x05MOV\x05[DI],AL
\x05
\x05
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'H'
\x05INC\x05DI
\x05MOV\x05BYTE\x05PTR [DI],'$'
\x05LEA\x05DX,STR
\x05MOV\x05AH,9
\x05INT\x0521H
\x05MOV\x05AH,4CH
\x05INT\x0521H
CODE\x05ENDS
\x05END START
编程计算(A*B+C-70)/A计算结果的商和余数分别保存在变量D和E中,其中A,B,C,D,E均
设变量a、b、c、d和y都已正确定义并赋值.若有以下if语句
汇编程序:计算[d-(a*b+c)]/a,a,b,c,d均为无符号数,将结果商存入AX中,余数存入DX中.
VB程序 下列为整形变量的是?A.B.X# C.X% D.X$
若变量已正确定义,要通过以下语句给a,b,c,d 分别输入字符A,B,C,D,给w.x.y.z分别输入整数10、20、3
编写程序计算Z=(A+B)-(C-D),其中A=30H,B=20H,C=10H,D=05H均为字单元无符号数.用汇编语言
这个C题目真的不懂,若有如下程序段,其中s、a、b、c均已定义为整型变量,且a、c均已赋值(c大于0):s=a;for(
写出语句scanf(“%d%c%f”,&a,&b,&c);中所用变量的正确定义.
C语言:以下程序执行后,变量x和变量y的值分别为 ()
已定义ch为字符型变量,以下赋值语句中错误的是().A:ch='\'; B:ch=62+3; C:ch=NULL; D:
若变量X Y的值分别为4,2.则表达式(x+y)/X*Y的值 A 3 B 0.25 c 0.75 d 4
类中所有实例共享的变量是什么变量?A 类变量 B 实例变量 C共有变量 D 所有变量