| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4654 人关注过本帖
标题:emu8086的高手进来帮忙下,拜托
只看楼主 加入收藏
阔怀
Rank: 2
等 级:论坛游民
帖 子:19
专家分:27
注 册:2015-1-31
结帖率:100%
收藏
 问题点数:0 回复次数:0 
emu8086的高手进来帮忙下,拜托
我是刚学emu8086的新手,在用这软件运行显示字的操作中遇到了麻烦。
代码:
data segment
       car  db  238  ;阳泉学院字符图形表,car是循环变量,存放循环次数
       DB  2ah,238,0,0
       DB  2ah,238,1,0  ;以下13行可用一句话代替:
DB  2ah,238,1,0  ; DB 13 DUP (2ah,238,1,0)
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       db  2ah,238,1,0
       DB  2ah,238,-13,1
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       db  2ah,238,1,0
       DB  2ah,238,-4,-3
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,4,-2
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,0,3
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,-1,0
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,0,1
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       DB  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,-4,-3
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,4,-2
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,-10,7
       db  2ah,238,0,1
       db  2ah,238,1,-3
       db  2ah,238,0,1
       db  2ah,238,1,-3
       db  2ah,238,0,1
       db  2ah,238,1,-1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,-8
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,-1,0
       db  2ah,238,-1,0
       db  2ah,238,-1,0
       db  2ah,238,1,-7
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,3,-1
       db  2ah,238,1,-4
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,-4
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,0,-2
       db  2ah,238,1,1
       db  2ah,238,-4,0
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,-4,6
       db  2ah,238,1,1
       db  2ah,238,1,1
       db  2ah,238,1,1
       db  2ah,238,1,1
       db  2ah,238,-12,1
       db  2ah,238,-2,1
       db  2ah,238,1,0
       db  2ah,238,0,1
       db  2ah,238,-1,2
       db  2ah,238,0,1
       db  2ah,238,1,0
       db  2ah,238,0,1
       db  2ah,238,0,2
       db  2ah,238,0,1
       db  2ah,238,-1,0
       db  2ah,238,0,1
       db  2ah,238,3,-10
       db  2ah,238,-1,0
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,0
       db  2ah,238,1,-8
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,1,-4
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,-5
       db  2ah,238,1,1
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,-1
       db  2ah,238,-1,-1
       db  2ah,238,-13,8
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,-14,1
       db  2ah,238,0,1
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,-4,-1
       db  2ah,238,4,0
       db  2ah,238,-8,5
       db  2ah,238,0,1
       db  2ah,238,1,0
       db  2ah,238,0,1
       db  2ah,238,2,-4
       db  2ah,238,-1,0
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,0
       db  2ah,238,1,-2
       db  2ah,238,0,-1
       db  2ah,238,0,-1
       db  2ah,238,0,-1
       db  2ah,238,2,-1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,0,1
       db  2ah,238,1,-4
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,1,-1
       db  2ah,238,-7,6
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,0
       db  2ah,238,1,1
       db  2ah,238,1,1
       db  2ah,238,1,1
char_cnt dw ?
pointer  dw ?
line_on  db ?
col_on   db ?
data     ends
stack  segment
     db  2000 dup (0)
stack  ends
code segment
     assume cs:code,ds:data
main proc far
     push ds
     sub ax,ax
     push ax
     mov ax,data          ;初始化DS
     mov ds,ax
     mov ah,0             ;设置300*200彩色图形方式
     mov al,3
     int 10h
     mov ah,0bh           ;设置背景颜色
     mov bh,0
     mov bl,2
     int 10h
     mov ah,0bh           ;设置彩色调板
     mov bh,01
     mov bl,00
     int 10h
     call clear_screen    ;清屏
     lea di,car           ;di指向字符图形表
     mov dh,5             ;从第5行第5列位置开始
     mov dl,5             ;显示汽车
     call move_shape
     mov ah,01h           ;从键盘输入字符
     int 21h
     cmp al,0dh
     je exit
exit:mov ah,4ch
     int 21h
     ret
main endp
clear_screen proc near    ;清屏子程序
     push ax              ;保护寄存器
     push bx
     push cx
     push dx
     mov ah,6             ;屏幕上卷功能
     mov al,6
     mov ch,0             ;左上角行号
     mov cl,0             ;左上角列号
     mov dh,250           ;右下角行号
     mov dl,200           ;右下角列号
     mov bh,7             ;卷入行属性
     int 10h              ;调用显示功能
     pop dx               ;恢复寄存器
     pop cx
     pop bx
     pop ax
     ret                  ;返回主程序
clear_screen endp
move_shape proc near
     push ax
     push bx
     push cx
     push dx
     push di
     mov ah,0fh           ;取当前显示方式
     int 10h
     sub ch,ch            ;清除寄存器CX的高字节
     mov cl,[di]          ;CL放循环次数
     inc di               ;di指向字符表的第一个字符
     mov char_cnt,cx      ;保存循环次数
     mov pointer,di
     mov line_on,dh
     mov col_on,dl
plot_next:
     add dh,[di+2]        ;改变行列指针
     add dl,[di+3]
     cmp dl,150           ;出屏否?

     jb mov_crsr
     call erase
     pop di
     pop dx
     pop cx
     pop bx
     pop ax
     ret
mov_crsr:
     mov ah,2             ;移动光标位置           
     int 10h
     mov al,[di]
     mov bl,[di+1]        ;取字符值及属性
     push cx
     mov cx,1
     mov ah,09            ;显示字符
     int 10h
     pop cx
     add di,4             ;di指向下一个字符
     loop plot_next
     call dly_qrtr        ;调用延时子程序
     call erase           ;调用擦除子程序
     jmp short plot_next
move_shape endp
erase proc near           ;擦除子程序
     mov cx,char_cnt
     mov di,pointer
     mov dh,line_on
     mov dl,col_on
erase_next:
     add dh,[di+2]
     add dl,[di+3]
     mov ah,2
     int 10h
     mov al,[di]
     mov bl,0
     push cx
     mov cx,1
     mov ah,9
     int 10h
     pop cx
     add di,4
     loop erase_next
     mov cx,char_cnt
     mov di,pointer
     mov dh,line_on
     inc col_on
     mov dl,col_on
     ret
erase endp
dly_qrtr proc near         ;延时子程序
     push cx
     push dx
     mov dx,50000
 d11:mov cx,8000
 d12:loop d12
     dec dx
     jnz d11
     pop dx
     pop cx
     ret
dly_qrtr endp
code ends
     end main

这个是可以运行的,但当显示的字的点数超过DB的最大值时255,就不能完全显示。我试用了DW的,但不知怎么改,改了几遍都不能显示出字。。。救大神支援
搜索更多相关主题的帖子: 软件 学院 阳泉 
2015-03-25 17:16
快速回复:emu8086的高手进来帮忙下,拜托
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038306 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved