我想在 asm 中画一条彩色线。我必须在 x86 intel linux 单元上使用 AT&T 语法。我已经走得很远了,但我想知道如何进入 VGA 模式或模式 X,以及如何在屏幕上放置一个像素。在标准 C 库(如 printf)中是否有一个函数?
非常感谢你的帮助。:)
.bss # Declaring uninitialized variables
.data # Declaring initialized variables
.text # Actual assembly code and constants
intro: .asciz "Draw a line in VGA\n\n"
clr: .asciz "Give a color \n"
optns: .asciz "red (1), blue (2), white (3)\n"
res .asciz "%d"
ent: .asciz "\n"
.global main # Tell kernel where to start (visible from outside)
Run Code Online (Sandbox Code Playgroud)
main: pushl %ebp # Push base pointer
movl %esp, …
Run Code Online (Sandbox Code Playgroud)