assembly - 将 2 个像素点在一起

标签 assembly graphics x86 dos framebuffer

我在第一个像素的右侧点了一个像素,但结果不同。第二个像素距离第一个像素很远。

出了什么问题?

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

谢谢!

最佳答案

有两个错误。

首先,8 位/像素的 BIOS 320x200 是视频模式 13h (19d),而不是您所拥有的 13d

修复它:

mov ax,13h
int 10h

另一个错误是您将 ax 而不是 al 写入视频内存。将 ax 替换为 al 或任何其他 8 位寄存器(ahblbhclchdldh):

mov al,1
mov [es:di],al
inc di
mov [es:di],al

应该可以了。

关于assembly - 将 2 个像素点在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14081088/

相关文章:

assembly - 操作系统 不同架构的汇编语言

c++ - CLWB(缓存行回写)到同一位置与循环通过几行的性能低下

linux - 从程序集 AT&T 中的文件中读取数据

c - 这两条指令在下面的函数中做了什么?

assembly - 为 X86 编译时如何防止函数对齐到 16 字节边界?

macos - MacOS 程序集的 64 位系统调用文档

assembly - MIPS 汇编作业。好像找不到bug

graphics - 谁能推荐一种语言来模仿/重拍原始的俄勒冈小道?

Linux命令行图形

java - 如何在另一个类中的 JPanel 类中实现 ActionListener?