简体   繁体   English

为什么最后有一个十六进制转换器的对象?

[英]why is there a object to hex converter in the end?

I am studying assembly language programming.I came across steps to a program for a microcontroller.我正在学习汇编语言编程。我遇到了微控制器程序的步骤。 In the last step why is the .obj file is converted to .hex file.在最后一步中为什么 .obj 文件被转换为 .hex 文件。 The process says that file is converted to .hex and burned to ROM.As per my understanding the .obj file is already a machine language code and can be run.该过程说该文件已转换为 .hex 并刻录到 ROM。根据我的理解,.obj 文件已经是一个机器语言代码,可以运行。 If this question makes sense please explain why is there a need of OH converter in the last step?如果这个问题有意义,请解释为什么在最后一步需要 OH 转换器? 在此处输入图片说明

"obj" could be anything, there's no standard. “obj”可以是任何东西,没有标准。 It may be machine code, it may be some abstract "object code" format, it may or may not contain debugging information (such as variable/function names).它可能是机器代码,也可能是某种抽象的“目标代码”格式,可能包含也可能不包含调试信息(例如变量/函数名称)。 Typically it is not the final binary but a format that the linker understands.通常它不是最终的二进制文件,而是链接器理解的格式。

Even if you write in assembler, you have to download that code into memory somehow, either through an in-circuit debugger or through a dedicated circuit programmer.即使您使用汇编程序编写,也必须通过在线调试器或专用电路编程器以某种方式将该代码下载到内存中。 Then you need a file format that your tool can handle.然后您需要一种您的工具可以处理的文件格式。

"abs" is typically machine code but with debugging information included, used for downloading and troubleshooting a program through a debugger. “abs”通常是机器代码,但包含调试信息,用于通过调试器下载和排除程序故障。

"hex" is standardized "Intel hex" format, which is raw machine code with no debugging info, expressed in an ASCII format. “hex”是标准化的“Intel hex”格式,它是没有调试信息的原始机器代码,以 ASCII 格式表示。 It is commonly used by in-circuit programmers and a common format to use for the final product binary in production.它通常由在线编程人员使用,并且是用于生产中最终产品二进制文件的通用格式。 (Other such common formats are .bin and .s19) (其他此类常见格式是 .bin 和 .s19)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 组装GAS Converter十六进制二进制 - Assembly GAS Converter hex for binary 通过十六进制转换器无法读取NASM的Bin文件输出 - Trouble Reading Bin File Output of NASM through a Hex Converter 为什么这个汇编语言程序以相反的顺序打印十六进制数字? - Why does this assembly language program print hex digits in reverse order? 为什么计算机以汇编语言使用十六进制数字系统? - Why do Computers use Hex Number System at assembly language? 为什么我的 MIPS 基本转换器在当前值之后打印出前一个循环中的值? - Why is my MIPS base converter printing out the values from a previous loop after the current values? 为什么这个汇编程序以无限循环结束? - Why do this assembly program end with a infinite loop? 为什么我的代码将在启动功能结束时崩溃? - Why my code will crash at the end of the start function? 为什么汇编中字符串变量的末尾包含 0? - Why is 0 included at the end of a string variable in assembly? 为什么在gdb中从反汇编中获得的偏移量在十六进制编辑器中显示超出范围的错误? - Why offset got from disassembly in gdb shows out of range error in hex editors? 为什么二进制值与NASM x86中的十六进制表示不匹配? - Why doesn't the binary value match its hex representation in NASM x86?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM