Visual Studio ARM 汇编器可以生成不需要操作系统的二进制文件吗?

发布于 2024-08-19 14:25:43 字数 341 浏览 1 评论 0原文

我首先承认,我对 ARM 开发了解不多,所以我的信息可能有误。

Visual Studio 附带了一个 ARM 汇编器 (armasm.exe),这非常方便,因为我基本上使用 VS 附带的工具来完成所有事情,而且我不太愿意花钱购买与我的 C 编译器捆绑在一起的 ARM 汇编器。永远不会使用其他公司的。

现在,我的理解是,在金属上运行的 ARM 二进制文件需要采用纯二进制格式,而不是 ELF 或 PE 之类的格式。 ARMASM 是否能够输出无需操作系统即可运行的二进制文件? ARMASM 的 MSDN 文档似乎缺乏此类信息。

如果没有,您能否推荐一个免费的 ARM 汇编器,它提供宏支持并且不捆绑一堆额外的东西?

I'll admit upfront that I don't know a whole lot about ARM development, so I probably have by information wrong here.

Visual Studio comes with an ARM assembler (armasm.exe), which is extremely convenient because I use the tools included with VS for basically everything and I'm not too wild about paying for an ARM assembler that comes bundled with a C compiler that I'll never use from other companies.

Now, my understanding is that ARM binaries that are run on-the-metal need to be in a pure binary format instead of something like ELF or PE. Is ARMASM capable of outputting binaries that can run without an operating system? The MSDN documentation for ARMASM appears to be lacking in regards to that type of information.

If not, can you recommend a free ARM assembler that provides macro support and doesn't come bundled with a bunch of extra fluff?

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

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

发布评论

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

评论(1

任谁 2024-08-26 14:25:43

汇编器只生成目标文件。由链接器来生成最终的可执行文件。我很确定微软几乎使用了他们常用的链接器,它生成 PE 格式的可执行文件(这是一个 COFF 变体,如果你关心的话)。顺便说一句,我不知道有一个链接器/定位器可以采用 MS-COFF 格式的目标文件并生成纯二进制输出文件(尽管这并不意味着不存在 - 我从未真正寻找过)。

另请注意,在裸机上运行大多数意味着将文件刻录到 ROM 的某些变体。这意味着您确实不需要纯二进制输出文件——您真正需要的是适合 ROM 刻录机的文件。这通常意味着 Motorola S-record 或 Intel 十六进制格式(相当多的 ROM 刻录程序都接受这两种格式)。

我知道这并没有给你一个“最终答案”,但它至少应该给你一些适合谷歌搜索的术语,以获取更多相关信息......

The assembler just produces object files. It's up to the linker to produce the final, executable, file. I'm pretty sure Microsoft uses pretty much their usual linker, which produces PE format executables (which is a COFF variant, in case you care). Offhand, I don't know of a linker/locator that will take MS-COFF format object files and produce a pure binary output file (though that hardly means one doesn't exist -- I've never really looked for one).

Also note that running on the bare metal most means burning your file to some variant of ROM. That means you really don't need a pure binary output file -- what you really need is a file suitable for a ROM burner. That usually means Motorola S-records or Intel hex format (quite a few ROM burners accept both).

I know that doesn't give you a "final answer", but it should at least give you a few terms suitable for Googling to get more relevant information...

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