如何在汇编程序中更改屏幕背景
这是家庭作业:
如何清除屏幕并更改汇编程序中的前景和背景颜色(Windows 上的 NASM)
编辑:事实证明答案是这样的
mov bh, 71h
int 10h
This is for homework:
How do I clear the screen and change foreground and background colors in assembler (NASM on windows)
EDIT: It turns out the answer is something like
mov bh, 71h
int 10h
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 FillConsoleOutputCharacter 和 SetConsoleTextAttribute。
Check out FillConsoleOutputCharacter and SetConsoleTextAttribute.
您可能需要一些操作系统服务才能获得此类功能。既然这是一个要求,那么您将如何用另一种语言来做到这一点?一旦弄清楚这一点,您就可以从汇编语言程序中进行相同的调用。类似于:
其中
OSServiceClearScreen
是执行您想要的操作的系统调用或库函数的名称。然后只需将您的汇编程序与正确的库链接起来,它就应该“正常工作”。You'll probably need some operating system services to get that kind of functionality. Since that's a requirement, how would you do it from another language? Once you figure that out, you can just make the same calls from your assembly language program. Something like:
where
OSServiceClearScreen
is the name of the system call or library function that performs the operation you want. Then just link your assembly program with the right libraries and it should all "just work".