汇编网首页登录博客注册
masmaster的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
文章收藏

[2010-09-07 21:44] 习题4.17

写一个实现习题4.16的功能, 按回车结束程序。

答:
;-----------------------------------------------------
assume        cs:code
code        segment
start:
        mov si,0
        mov bx,13
s0:        mov dx,30h        
s1:        mov ah,2
        int 21h
        mov ah,1       ;加入输入判断,如输入回车则退出
        int 21h
        cmp al,0dh
        jz done
        inc si
        push dx
        xor dx,dx
        mov ax,si
        div bx
        cmp dx,0
        jnz s2
        call cr
        pop dx
        inc dx
        jmp s1
s2:        pop dx
        inc dx
        cmp dx,39h
        ja s0
        jmp s1        
done:        mov ah,4ch
        int 21h
;
cr        proc
        mov dl,0dh
        mov ah,2
        int 21h
        mov dl,0ah
        mov ah,2
        int 21h
        ret
cr        endp
;
code        ends
end        start
;-----------------------------------------------------
评论次数(0)  |  浏览次数(330)  |  类型(汇编习题集) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码