用汇编语言实现下面的c语言表达式:if(a>=b){x=c-d;} else x=c+d 10
1个回答
展开全部
核心代码是:
DATA SEGMENT
a db 50H
b db 70H
c db 60H
d db 40H
x db ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
START:
MOV AX,DATA
MOV DS,AX
mov ax,a
mov bx,b
mov cx,c
mov dx,d
cmp ax,bx
jae @F
add cx,dx
jmp EXIT_ME
@@:
sub cx,dx
EXIT_ME:
mov x,cx
mov ah,4cH
int 21H
CODE ENDS
END START
DATA SEGMENT
a db 50H
b db 70H
c db 60H
d db 40H
x db ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
START:
MOV AX,DATA
MOV DS,AX
mov ax,a
mov bx,b
mov cx,c
mov dx,d
cmp ax,bx
jae @F
add cx,dx
jmp EXIT_ME
@@:
sub cx,dx
EXIT_ME:
mov x,cx
mov ah,4cH
int 21H
CODE ENDS
END START
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询