点2像素在一起 [英] dot 2 pixels together
本文介绍了点2像素在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我点像素紧邻第一像素,但结果是不同的。第二像素远离的第一个。
I dot a pixel right next first pixel but the result is different. Second pixel is far away from first one.
怎么了?
org 100h
;change to 320x200 graphic mode
mov ax, 13
int 10h
;frame buffer location
push 0xa000
pop es
xor di, di
;dot 2 pixels
mov ax, 1
mov [es:di], ax
inc di
mov [es:di], ax
;prevent ending
a:
jmp a
谢谢!
推荐答案
有两个错误。
首先,BIOS 320x200的8位/像素为视频模式 13小时
( 19D
),而不是 13D
你有。
First, BIOS 320x200 at 8 bits/pixel is video mode 13h
(19d
), not 13d
as you have.
要解决这个问题:
mov ax,13h
int 10h
另一个错误是,你写的斧
而不是人
显存。替换斧
与人
或任何其他8位寄存器(啊
, BL
, BH
, CL
, CH
, DL
, DH
)
The other bug is that you write ax
instead of al
to video memory. Replace ax
with al
or any other 8-bit register (ah
, bl
, bh
, cl
, ch
, dl
, dh
):
mov al,1
mov [es:di],al
inc di
mov [es:di],al
这应该这样做。
这篇关于点2像素在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文