x86 asm图形设置的分辨率高于640x480? [英] x86 asm graphics settings for resolutions higher than 640x480?
问题描述
我刚刚开始使用汇编语言(感觉就像学习新东西一样),并且遇到了一些问题(到目前为止),我一直在浏览的所有教程都没有回答,或者太老了而无法知道.
I've just started using assembly language (felt like learning something new), and have run into a few questions (so far) that all the tutorials I've been looking through don't answer, or are too old to know.
1)我尝试了几次搜索(也许我只是不知道正确的关键字),但是找不到用于更改屏幕分辨率等的图形模式的更新列表.是:汇编程序教程,我几乎认为640x480是可以使用最佳分辨率的汇编语言. 有人知道我可以使用更新的教程吗?
1) I've tried a few searches (maybe I just don't know the right keywords), but I can't find an updated list of graphics modes for changing screen resolutions, etc. The best I've found is: Assembler Tutorial, and I'd hardly think that 640x480 is the best resolution assembly language can use. Does anyone know of a more updated tutorial I can use?
中断10h很旧,并且不能完全支持640x480以上
2)是否可以将一个值从一个变量移动"到另一个变量而无需先将其移动到寄存器?示例:
2) Is it possible to "mov" a value from a variable to another variable without moving it to a register first? Example:
jmp start
n1 dw 0
n2 dw 0
res dw 0
start:
mov n1,5
mov n2,6
mov res,n1
add res,n2
...etc...
不可能.不使用寄存器就无法在内存之间切换.
3)关于问题1,是否有办法检测用户当前使用的图形模式,以便我可以对其进行更改,然后再将其更改回? (我想有,但是不确定如何做.)
3) Going with question 1, is there a way to detect what graphics mode a user is currently using, so that I can change it, and change it back after? (I assume there is, but am not sure how to do it.)
需要在操作系统中查询图形设置.
推荐答案
For questions #1 and #3, look into the VESA BIOS Extensions. This was something of a standard for dealing with "Super VGA" modes, popular in the 90s.
对于#2,通常答案是否",您不能在内存之间移动内存.但这并非完全正确:存在MOVS(移动字符串),它将字节,字或dword从DS:SI移至ES:DI.通常,此指令与REP前缀一起使用以移动内存块.另外,假设您已设置堆栈,则可以通过按入和弹出来在不破坏寄存器的情况下将内存移至内存:
As for #2, in general the answer is no, you can't MOV memory to memory. But it's not strictly true: there is MOVS (move string), which moves a byte, word, or dword from DS:SI to ES:DI. Usually this instruction is used in conjunction with a REP prefix to move blocks of memory. Also, assuming you have a stack set up, you can move memory-to-memory without clobbering a register by pushing and popping:
PUSH [mem1]
POP [mem2]
这篇关于x86 asm图形设置的分辨率高于640x480?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!