assembly - 装配:无法在图形模式下绘制正方形
问题描述
我在汇编中编写了该代码:
[bits 16]
[org 0x7c00]
mov ah, 0 ;
mov al, 13h ; set graphic mode
int 10h ;
mov cx, sx
mov dx, sy
mov ah, 0ch
colcount:
inc cx
int 10h
cmp cx, hh
jne colcount
mov cx, sx
inc dx
cmp dx, ww
jne colcount
;;; vars section
sx dd 0 ;start x position
sy dd 0 ;start y position
hh dd 30 ;height
ww dd 30 ;width
times 510 - ($ - $$) db 0x0
dw 0xaa55
我希望这段代码在屏幕的左上角绘制一个正方形,但它只在中间绘制一个矩形。
我不知道问题出在哪里。
我使用 nasm 作为编译器,没有任何错误消息。
我从这里获取了部分代码,感谢YonBruchim。
解决方案
推荐阅读
- android - Recyclerview 预览显示灰屏,android.support.v7.widget.RecyclerView 居中
- html - jquery验证select2.js中的errorPlacement
- c# - c# data pull from json - 无法检测到单词之间的“-”符号
- java - 通过删除不需要的依赖项或替换启动器来减小 Java Spring 应用程序的大小
- types - 如何在制作实例期间强制检查插槽的类型?
- sql - 错误:3704 对象关闭时不允许操作
- android - Android 芯片自定义高度或填充 - 芯片组间距
- python-3.x - 如何获取成员的服务器详细信息
- javascript - 如何观察 OWA 中“新邮件”页面字段中发生的事件?
- gcc - MSYS2 - 安装 gcc 或工具链?