本帖最后由 IJK 于 2010-8-6 14:06 编辑
http://en.wikipedia.org/wiki/Intel_HEX
0000B191应该是需要装入的地址,估计是供后面的 hex目标码用。
05, Start Linear Address Record. The address field is 0000, the byte count is 04. T ...
IJK 发表于 2010-8-4 11:43 [/quote]
还是举例说明,才能弄清楚。我的代码生成的部分HEX如下:
:020000040800F2
:1000000000040020594A0008A1420008A342000849
:10001000A5420008A7420008A9420008000000000D
... ...
:104C700006070809FFFFFFFFFFFFFFFF020406080A
:084C8000FFFFE8030100000042
:0400000508004ABDE8
:00000001FF
此段与LZ的一样,类型为05:
:0400000508004ABDE8
其中的地址是0x08004ABD,当我下载代码到芯片里后(不勾选 run to main),程序恰好停在 0x08004ABD,对应于标号: __iar_program_start
维基百科是这么说:
http://en.wikipedia.org/wiki/Intel_HEX
05, Start Linear Address Record. The address field is 0000, the byte count is 04. The 4 data bytes represent the 32-bit value loaded into the EIP register of the 80386 and higher CPU.
根据 http://en.wikipedia.org/wiki/X86_assembly_language
The instruction pointer is called ip in 16-bit mode, eip in 32-bit mode, and rip in 64-bit mode. The instruction pointer register points to the memory address which the processor will next attempt to execute
实际上 EIP 寄存器就是 STM8或者ARM芯片的PC指针。
可见,上面维基百科的描述是对的:类型05后面跟的是4字节地址,将赋给(STM8或者ARM芯片的)PC指针。
|