Intel HEX-record Format
INTRODUCTION
Intel's Hex-record format allows program or data files to be encoded in a printable (ASCII) format. This allows viewing of the object file with standard tools and easy file transfer from one computer to another, or between a host and target. An individual Hex-record is a single line in a file composed of many Hex-records.
HEX-RECORD CONTENT
Hex-Records are character strings made of several fields which specify the record type, record length, memory address, data, and checksum. Each byte of binary data is encoded as a 2-character hexadecimal number: the first ASCII character representing the high-order 4 bits, and the second the low-order 4 bits of the byte.
The 6 fields which comprise a Hex-record are defined as follows: Field Characters Description
1 Start code 1 An ASCII colon, ":".
2 Byte count 2 The count of the character pairs in the data field.
3 Address 4 The 2-byte address at which the data field is to be loaded into memory.
4 Type 2 00, 01, or 02.
5 Data 0-2n From 0 to n bytes of executable code, or memory loadable data.
n is normally 20 hex (32 decimal) or less.
6 Checksum 2 The least significant byte of the two's complement sum of the values represented by all the pairs of characters in the record except the start code and checksum.
Each record may be terminated with a CR/LF/NULL. Accuracy of transmission is ensured by the byte count and checksum fields.
HEX-RECORD TYPES
There are three possible types of Hex-records. 00 A record containing data and the 2-byte address at which the data is to reside.
01 A termination record for a file of Hex-records. Only one termination record is allowed per file and it must be the last line of the file. There is no data field.
02 A segment base address record. This type of record is ignored by Lucid programmers.
HEX-RECORD EXAMPLE
Following is a typical Hex-record module consisting of four data records and a termination record.
:10010000214601360121470136007EFE09D2190140
:100110002146017EB7C20001FF5F16002148011988
:10012000194E79234623965778239EDA3F01B2CAA7
:100130003F0156702B5E712B722B732146013421C7
:00000001FF
The first data record is explained as follows:
: Start code.
10 Hex 10 (decimal 16), indicating 16 data character
pairs, 16 bytes of binary data, in this record.
01 Four-character 2-byte address field: hex address 0100,
00 indicates location where the following data is to be loaded.
00 Record type indicating a data record.
The next 16 character pairs are the ASCII bytes of the actual program data.
40 Checksum of the first Hex-record.
The termination record is explained as follows:
: Start code.
00 Byte count is zero, no data in termination record.
00 Four-character 2-byte address field, zeros.
00
01 Record type 01 is termination.
FF Checksum of termination record. 专栏文章内容及配图由作者撰写发布,仅供工程师学习之用,如有侵权或者其他违规问题,请联系本站处理。 联系我们
相关推荐
本土企业在机器人一体化关节产业链具备机会
DSP一问,请指教(转载)
能效革命 智控未来,LED照明产业驶向千亿级快车道
“zangchao”STM32与51单片机串口通信演示视频
纳芯微发布双通道电流检测放大器NSCSA285,赋能工业与能源管理
古尔曼:苹果 iPadOS 19 体验将更像 macOS
“cjingguo”的AD温度采集视频
CYGWIN软件
俺刚才在FTP1传了几百M文件
Tornado/VxWorks预估考题(奥索)
555间歇时间可调的定时器电路
动态离散周期变换技术突破:无ECG参考的生理信号精准解析
ES51960 数字万用表芯片
学子专区论坛 - ADALM2000实验:Hartley振荡器
0.1秒~6小时定时电路
FM2306A多费率电表芯片
破解运放稳定性谜题:工程师必备的稳定性设计手册
555顺序定时控制电路
0~16小时无级定时控制器电路
具可编程基准的同步降压型稳压器
“cjingguo”的跑马灯视频
纳芯微发布车规级电流检测放大器NSCSA240-Q1系列
Tablet PC 价格昂贵 锁定“可以报销”的商业用户
学子专区论坛- ADALM2000实验:脉宽调制
[求助]MCF5272能接16位端口的RAM吗?
C源码格式化工具
“shangziyun”的跑马灯视频
eMule-0.47c-VeryCD1215-Setup
L Nanopower革新智能家居能源架构:nA级功耗技术破解无线终端续航困境
555分段式定时电路