汇编实验1. 计算1+2+3+…+10,将结果显示在屏幕上。4

assume cs: code
code segment
    mov cx,10d
    mov ax,0
    mov bx,0
s:
    inc bx
    add ax,bx
    loop s
    mov bl,10d
    div bl
    mov bh,ah
    mov bl,al
    mov dl,bl
    add dl,30h
    mov ah,2
    int 21h
    mov dl,bh
    add dl,30h
    mov ah,2
    int 21h
code ends
end 

运行结果

猜你喜欢

转载自www.cnblogs.com/lhclqslove/p/8976077.html