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

我的博客

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

[2011-03-26 16:47] 程序驻留1

图片载入中
.model        small;没有移除光标,没有按键就退出的功能,把1CH功能当延时
.code
old1ch        dd        ?
var        db        0ffh
new1ch:        push        ax
        push        bx
        push        cx
        push        es
        push        dx
        mov        ax,0b800h
        mov        es,ax
        mov        di,0
        mov        cx,2000
        mov        dl,var
s1:        mov        bx,es:[di]
        cmp        bl,30h
        jne        s2
        mov        BYTE ptr es:[di+1],dl
s2:        add        di,2
        loop        s1
        dec        dl
        mov        var,dl
        pop        dx
        pop        es
        pop        cx
        pop        bx
        pop        ax
        jmp        cs:old1ch
start:        mov        ax,0b800h
        mov        es,ax
        xor        di,di
        xor        bx,bx
        mov        cx,2000
s:        call        fun
        add        di,2
        loop        s
begin:        push        cs
        pop        ds
        mov        ax,351ch
        int        21h
        mov        WORD ptr [old1ch],bx
        mov        WORD ptr [old1ch+2],es
        mov        dx,offset new1ch
        mov        ax,251ch
        int        21h
        
        mov        dx,offset begin
        add        dx,15
        mov        cl,4
        shr        dx,cl
        add        dx,10h
        mov        ah,31h
        int        21h
        
fun:
        push        ax
        push        bx
        push        dx
        mov        ax,di
        mov        bx,160
        xor        dx,dx
        div        bx
        test        ax,1
        jz        @@1
        cmp        ax,12
        jb        @@5
        mov        bx,24
        sub        bx,ax
        mov        ax,bx
@@5:        dec        ax
        cmp        dx,80
        ja        @@7
@@8:        xchg        dx,ax
        mov        bl,8
        div        bl
        cmp        ah,0    ;cmp ah,0或2 列就为双层
        jne        @@4
        shr        dx,1
        cmp        dx,ax
        jae        @@6
        jmp        @@4
@@7:        xchg        dx,ax
        mov        bl,8
        div        bl
        cmp        ah,6   ;cmp ah,6或4 列就为双层
        jne        @@4
        shr        dx,1
        xor        ah,ah
        add        dx,ax
        cmp        dx,19
        jae        @@6        
@@4:        mov        BYTE ptr es:[di],' '
        jmp        @@@
@@1:        cmp        ax,12
        jb        @@2
        mov        bx,24
        sub        bx,ax
        mov        ax,bx
@@2:        shl        ax,1
        shl        ax,1
        cmp        dx,ax
        jae        @@3        
        jmp        @@8
@@3:        add        ax,dx
        cmp        ax,158
        ja        @@7
@@6:        mov        BYTE ptr es:[di],30h
@@@:        pop        dx
        pop        bx
        pop        ax
        ret        
end        start
评论次数(0)  |  浏览次数(854)  |  类型(章节要点) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码