汇编程序有哪些限制? (NASM)

发布于 2024-09-03 04:55:13 字数 167 浏览 1 评论 0原文

使用汇编程序 (NASM) 编写的程序类型是否存在技术限制?
目前我只看到一些执行算术运算的程序,例如将两个数字相加。

是否可以编写复杂的汇编程序,提供 GUI、访问文件系统、播放声音等?

我知道我不会编写这样的程序,但我很好奇,我可以用汇编程序编写什么样的程序是否存在技术限制。

Is there a technical limitation of what kind of programs I can write with assembler (NASM)?
For now I've only seem some program that do arithmetic operations, like adding two numbers.

Is it possible to write complex assembler programs, that provide a GUI, access the file system, plays sounds et cetera?

I know I wouldn't write such programs, but I'm curious, if there are technical limitations on what kind of programs I can write with assembler.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尸血腥色 2024-09-10 04:55:13

如果对目标系统有足够的了解,就可以通过 ASM 做任何您想做的事情。然而,还有其他一些因素导致管理变得困难。但我见过很多GUI是用ASM完成的。它们看起来并不是特别好看,但确实如此。我见过一个人用纯 ASM 编写了一款视频游戏(这款游戏涉及小行星,屏幕中间有一艘小船可以发射机枪或激光)。他想测试一下自己,之前已经做过一些ASM了。所以是的,无论你想要什么,都可以做到。

需要我提醒您,ASM 只是伪机器指令,所有其他代码最终都必须简化为伪机器指令吗?

Given sufficient knowledge of the target system, it's possible to do whatever you would like through ASM. However, there are other things at play that make it difficult to manage. But I've seen many GUIs that were done in ASM. They weren't particularly nice to look at, but they did. I've seen a guy write a video game (that game with the asteroids and you have a little ship in the middle of the screen that shoots a machine gun or laser) in pure ASM. He wanted to test himself, and had already done some ASM before. So yes, it can be done, whatever you would like.

Need I remind you that ASM is merely pseudo-machine instruction, to which all other code must eventually be reduced?

囚我心虐我身 2024-09-10 04:55:13

没有这样的限制。用 C 或 C++ 编写的程序在编译期间会作为汇编源代码经过一个阶段,因此根据定义,您可以使用汇编程序编写从完整操作系统(例如 Windows)到应用程序(例如 AutoCAD)的任何内容。但它不会特别有趣或富有成效,而且错误的数量可能会很大。

There are no limitations as such. Programs written in C or C++ pass through a stage as assembler source code during compilation, so by definition you could write anything from a complete operating system such as Windows to an application like AutoCAD in assembler. It wouldn't be particularly fun or productive though, and the number of bugs would likely be substantial.

成熟稳重的好男人 2024-09-10 04:55:13

不,对汇编程序可以做什么没有限制。在汇编程序中编写 GUI、访问文件系统、播放声音等是否实用是另一回事。

No, no limitations on what CAN be done with assembler. Whether it's practical to write a GUI, access the file system, play sounds, etc, in assembler is another matter.

骄兵必败 2024-09-10 04:55:13

过去,我认为许多计算机游戏都是用汇编程序编写的。我特别想到 1978 年为 TRS-80 推出的“空中交通管制员”游戏。它有基于角色的 UI、蜂鸣声和相当多的游戏逻辑,所有这些都在“实时”游戏中在 4k RAM 中运行的模拟。以下是包含该游戏一些信息的网站链接以及屏幕截图: http://atc.fastie .com/index.htm

Back in the day I think a number of computer games were programmed in assembler. I'm thinking in particular of the "Air Traffic Controller" game that came out for the TRS-80 in 1978. It had a character-based UI, beep sounds, and quite a bit of game logic all in a "realtime" game simulation that ran in 4k of RAM. Here's link to site with some info on that game, as well as a screenshot: http://atc.fastie.com/index.htm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文