是否有任何工具可以将 PIC 16F877A 的 ASM 转换为 C
我想将 ASM 文件转换为 C 程序。有没有可用的工具。 我的目的是将PIC 16F877A程序的汇编程序转换为C程序...
I want to convert ASM file to C program. is there any tools available for this.
My intention is to convert assembly program of PIC 16F877A program to C program...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自动将汇编语言转换为C语言的工具是一种反编译器。
有多个针对 x86 汇编语言的反编译器。
虽然我没有使用过,但我听说 IDA(交互式反汇编器)具有反编译为 C 的选项,并且支持 Microchip PIC 汇编语言。
了解 PIC 汇编的人可以很好地手动将代码从 PIC 汇编移植到 C。
第一步是将“.asm”文件的内容复制到“.c”文件并用“asm”关键字包装它。使用 SDCC 语法,生成的文件如下所示
:能够编译该“.c”文件并使用“diff”来确认它编译为相同的可执行文件。
有时,人们可以将汇编程序片段翻译成 C 函数,然后编译成相同的可执行文件(使用“diff”进行比较)。
下一步通常看起来像这样
从这里开始,您可以采取两条路径:
A tool that automatically converts assembly to C is a kind of decompiler.
There are several decompilers for x86 assembly language.
While I haven't used it, I hear that IDA, the Interactive Disassembler, has a decompile-to-C option, and supports Microchip PIC assembly language.
People who know PIC assembly can do a pretty good job manually porting code from PIC assembly to C.
The first step is copying the contents of the ".asm" file to a ".c" file and wrapping it with the "asm" keyword. With SDCC syntax, the resulting file looks something like:
You should be able to compile that ".c" file and use "diff" to confirm that it compiles to an identical executable.
A person can sometimes translate pieces of assembler into C functions that compile to identical executable (using "diff" to compare).
The next step often looks something like
From here, there are two paths you can take: