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

我的博客

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

[2010-09-22 20:44] 习题5.30

写一个程序在屏幕上循环显示26个大写字母,每行显示10个,逐行变换显示颜色。 按alt+f1键终止程序。


答:
;----------------------------------------------------;
assume        cs:code,ds:data
data        segment
divsor        dw        10
data        ends
code        segment
start:
        mov ax,data
        mov ds,ax
a:        
        mov ah,3
        int 10h
        mov ah,2
        int 10h
        mov al,41h
        mov bl,1
b:        
        push ax
        mov ah,2
        int 16h
        test al,00001000b
        jnz exit
        pop ax
        mov ah,9
        mov cx,1
        int 10h
        call delay
        inc dl
        inc bl
        mov ah,2
        int 10h
        push dx
        push ax
        mov al,dl
        sub ah,ah
        xor dx,dx
        div divsor
        cmp dx,0
        jnz jxa
        call crlf
        pop ax
        pop dx
        inc dh
        mov ah,2
        mov dl,0
        int 10h
        jmp jxb
jxa:        
        pop ax
        pop dx
jxb:        
        inc al
        cmp al,5ah
        ja a
        jmp b
;
exit:        
        mov ah,1
        int 16h
        jz a
        mov ah,0
        int 16h
        cmp ax,3b00h
        jnz a

over:        mov ah,4ch
        int 21h
;
crlf        proc
        mov ah,2
        mov dl,0dh
        int 21h
        mov dl,0ah
        int 21h
        ret
crlf        endp
;
delay        proc uses ax dx
        mov dx,1000h
        mov ax,0
de:        
        sub ax,1
        sbb dx,0
        cmp ax,0
        jne de
        cmp dx,0
        jne de
        ret
delay        endp
;
code        ends
end        start
;----------------------------------------------------;
评论次数(0)  |  浏览次数(539)  |  类型(汇编习题集) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码