汇编 IA32 中的游戏编程
我想在unix环境下用程序集IA 32编写贪吃蛇游戏。我从这里找到了这些代码,
这是我想要的吗?汇编器8086与IA32和Emu8086有什么区别?什么是 AT&T 类型组装?我完全糊涂了
I want to write snake game in assembly IA 32 in unix environment . I found these codes from here
is it what i wanted ? what is the different between assembler 8086 and IA32 and Emu8086? what is AT&T stype assembly ? I'm totally confused
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1- 汇编语言之间的差异:
有多少种语言就有多少种不同的体系结构。它们主要在语法和寄存器方面有所不同。
您可以在此处找到机器语言(汇编语言)列表。
有关什么是机器代码的信息,请阅读本文。
2-贪吃蛇游戏
确实是IA32或x86(同一语言的不同术语),但它是针对Windows的(实际上是DOS)。
它使用只能由 DOS 系统读取的中断 (int xxh)。
此外,Windows 和 Linux 上的 IA32 在语法上也有所不同。最显着的区别是寄存器:
mov %eax,%ebx (AT&T) 主要用于 unix 系统
mov ebx,eax (Intel) 主要用于 DOS/Windows
(请注意,寄存器被交换:源<->目标)
这也取决于您使用的汇编器。 tasm 和 nasm 显然支持 windows masm 语法。 (但它不会转换依赖于操作系统的中断)
此源可能会帮助您: http: //mcs.uwsuper.edu/sb/324/ASM/snake.asm
1- Difference between assembly languages:
There are as many languages as there are different architectures. They mostly differ in syntax and registers.
You can find a list of machine languages (assembly languages) here.
For information on what is machine code, read this.
2- The snake game
Is indeed in IA32 or x86 (different term for same language) but it is for windows (DOS actually).
It uses interrupts (int xxh) that can only be read by DOS systems.
Additionally, IA32 on windows and linux differ also in syntax. The most notable difference is that registers:
mov %eax,%ebx (AT&T) mostly used on unix systems
mov ebx,eax (Intel) mostly used in DOS/Windows
(note that register are swapped: source<->destination)
This also depends on the assembler you use. tasm and nasm are apparently supporting windows masm syntax. (it will not convert OS-dependent interrupts though)
This source might help you: http://mcs.uwsuper.edu/sb/324/ASM/snake.asm
8086 是一款非常古老的 Intel 处理器。随后是80386、80486和80586(更名为Pentium)。因为这些都以 86 结尾,所以我们倾向于称它们为 x86。 IA-32 或 Intel Architecture-32 特指 32 位 x86 处理器。
x86 很难看;学习汇编语言是一种很糟糕的语言。如果你学习了 MIPS 之类的东西并掌握了它的窍门,x86 就不那么难学了。
ARM 可能还不错,因为它仍然在嵌入式系统中经常使用。
在了解“Hello World”中发生的情况之前,不要尝试编写游戏
8086 is a very old Intel processor. It was followed by the 80386, 80486, and 80586(renamed Pentium). Because these all end in 86, we tend to call them x86. IA-32 or Intel Architecture-32 refers specifically to 32-bit x86 processors.
x86 is ugly; a terrible language to learn assembler in. If you pick up something like MIPS and get the hang of it, x86 is less of a monster to learn.
ARM might not be too bad to start with, because it's still used with some frequency in embedded systems.
Don't try to write a game, until you understand what's going on in "Hello World"