assume cs:codesg
datasg segment
db 'welcome to masm!',0
db 00000010b,00100100b,01110001b
datasg ends
codesg segment
start: mov ax,0600h;清屏
mov bh,3ah
mov cx,0000h
mov dx,184fh
int 10h
mov ax,0b800h;段寄存器初始化
mov es,ax
mov ax,datasg
mov ds,ax
mov si,0;data段中按字节增长
mov di,0;显示缓存中按字增长
mov bx,40h;第0行的中间位置
add bx,6e0h;从0行到第11行所加的距离
mov bp,0;显示的颜色,按字节增长
mov cx,3;循环3行
s: push cx
mov cl,[si]
mov ch,0
jcxz s0;如果读到0,说明一行结束了,返回外循环
mov es:[bx][di],cl
mov al,ds:11h[bp]
mov byte ptr es:[bx][di+1],al
inc si
inc di
inc di
jmp short s
s0: pop cx
add bx,160;指向下一行
inc bp;指向下一种颜色
mov si,0
mov di,0
loop s
mov ah,0;等待输入
int 16h
mov ax,4c00h;返回操作系统
int 21h
codesg ends
end start
以上是我的代码,我感觉是对的,可是结果是满屏幕都是 welcome to masm!
怎么回事啊? |