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

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
  •  何以解忧愁,唯有杜康酒!
  • 『姓名』:
  • 『性别』:男『发送消息
  • 个人说明:http://student.zjzk.cn/course_ware/data_structure/web/shu/shu6.3.2.htm
  • 详细信息『加为好友』
学习动态

[2010-10-06 20:48] 练习-查看640*480 16色图形模式下几种颜色

;子程序display入口参数
;cx列号
;dx行号
;al像素颜色
;子程序delay延时
stack segment stack
     db  100h dup(?)
stack ends
code segment
 assume cs:code,ds:code,ss:stack
 start:
       xor ax,ax         ;设置显示模式(640*480 16色图形)
       mov ah,0
       mov al,12h
       int 10h
       mov ah,0bh            ;置调色板背景色
       mov bh,0
       mov bl,0
       int 10h
       mov cx,0
       mov dx,0
       mov al,0
    s2:call display
       call delay
       inc al
       cmp al,10h
       je exit
       add cx,10
       jmp s2
 exit: mov ah,01
       int 21h                              ;esc退出观看效果                              
       cmp al,1bh
       jne exit
       mov ax,0003h
       int 10h
       mov ax,4c00h
       int 21h
 display:push ax
         push bx
         push si
         mov bx,cx
         mov si,cx
         add si,10     
    s: mov ah,0ch
       int 10h
       inc cx
       cmp cx,si
       jne s
       mov cx,bx
       inc dx
       cmp dx,10
       jne s
       mov dx,0
       pop si
       pop bx
       pop ax
       ret
 delay:push ax
       push dx
       mov dx,2000h
       mov ax,0
     s1:sub ax,1
        sbb dx,0
        cmp ax,0
        jne s1
        cmp dx,0
        jne s1
        pop dx
        pop ax
       ret
 code ends
 end start
评论次数(0)  |  浏览次数(1146)  |  类型(我的程序) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码