
汇编中如何显示某个寄存器中的内容
assumecs:code,ds:datadatasegmentsdMsgdb'1+2+3+4+...+100=$'dataendscodesegmentstart:mo...
assume cs:code, ds:data
data segment
sdMsg db '1+2+3+4+...+100=$'
data ends
code segment
start:
mov ax, data
mov ds, ax
lea dx, sdMsg
mov ah, 9
int 21h
xor ax, ax
xor dx, dx
mov cx, 100
next:
add ax, cx
loop next
mov ax, 4c00h
int 21h
code ends
end start
如何将ax中的数据显示出来,或者说重新写个程序:是关于1+2+。。。100
运算后将结果显示出来
希望可以先编译下在拿出来 展开
data segment
sdMsg db '1+2+3+4+...+100=$'
data ends
code segment
start:
mov ax, data
mov ds, ax
lea dx, sdMsg
mov ah, 9
int 21h
xor ax, ax
xor dx, dx
mov cx, 100
next:
add ax, cx
loop next
mov ax, 4c00h
int 21h
code ends
end start
如何将ax中的数据显示出来,或者说重新写个程序:是关于1+2+。。。100
运算后将结果显示出来
希望可以先编译下在拿出来 展开
2013-06-30
展开全部
谢谢……我是来拿分的
data segment
str db '1+2+3+4+...+100=$'
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
lea dx,str
mov ah,9
int 21h
xor ax,ax
mov cx,100
next:
add ax,cx
loop next
call display
mov ah,4ch
int 21h
display proc near
xor cx,cx
mov bx,10
continue1:
xor dx,dx
div bx
push dx
inc dx
inc cx
cmp ax,0
jnz continue1
continue2:
pop dx
add dl,30h
mov ah,2
int 21h
loop continue2
ret
display endp
code ends
end start
data segment
str db '1+2+3+4+...+100=$'
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
lea dx,str
mov ah,9
int 21h
xor ax,ax
mov cx,100
next:
add ax,cx
loop next
call display
mov ah,4ch
int 21h
display proc near
xor cx,cx
mov bx,10
continue1:
xor dx,dx
div bx
push dx
inc dx
inc cx
cmp ax,0
jnz continue1
continue2:
pop dx
add dl,30h
mov ah,2
int 21h
loop continue2
ret
display endp
code ends
end start
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询