欢迎来到天天文库
浏览记录
ID:55669148
大小:81.23 KB
页数:6页
时间:2020-05-23
《hex文件格式说明.pdf》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、WhatistheIntelHEXfileformat?TheIntelHEXfileisanASCIItextfilewithlinesoftextthatfollowtheIntelHEXfileformat.EachlineinanIntelHEXfilecontainsoneHEXrecord.Theserecordsaremadeupofhexadecimalnumbersthatrepresentmachinelanguagecodeand/orconstantdata.IntelHEXfilesareoftenusedtotransfertheprogramanddatathat
2、wouldbestoredinaROMorEPROM.MostEPROMprogrammersoremulatorscanuseIntelHEXfiles.RecordFormatAnIntelHEXfileiscomposedofanynumberofHEXrecords.Eachrecordismadeupoffivefieldsthatarearrangedinthefollowingformat::llaaaatt[dd...]ccEachgroupofletterscorrespondstoadifferentfield,andeachletterrepresentsasingleh
3、exadecimaldigit.Eachfieldiscomposedofatleasttwohexadecimaldigits-whichmakeupabyte-asdescribedbelow::isthecolonthatstartseveryIntelHEXrecord.llistherecord-lengthfieldthatrepresentsthenumberofdatabytes(dd)intherecord.aaaaistheaddressfieldthatrepresentsthestartingaddressforsubsequentdataintherecord.tti
4、sthefieldthatrepresentstheHEXrecordtype,whichmaybeoneofthefollowing:00-datarecord01-end-of-filerecord02-extendedsegmentaddressrecord04-extendedlinearaddressrecordddisadatafieldthatrepresentsonebyteofdata.Arecordmayhavemultipledatabytes.Thenumberofdatabytesintherecordmustmatchthenumberspecifiedbythel
5、lfield.ccisthechecksumfieldthatrepresentsthechecksumoftherecord.Thechecksumiscalculatedbysummingthevaluesofallhexadecimaldigitpairsintherecordmodulo256andtakingthetwo'scomplement.DataRecordsTheIntelHEXfileismadeupofanynumberofdatarecordsthatareterminatedwithacarriagereturnandalinefeed.Datarecordsapp
6、earasfollows::10246200464C5549442050524F46494C4500464C33where:10isthenumberofdatabytesintherecord.2462istheaddresswherethedataaretobelocatedinmemory.00istherecordtype00(adatarecord).464C...464Cisthedata.33isthechecksumoftherecord.ExtendedLinearAddressRecords(HEX386)Extendedlinearaddressrecordsareals
7、oknownas32-bitaddressrecordsandHEX386records.Theserecordscontaintheupper16bits(bits16-31)ofthedataaddress.Theextendedlinearaddressrecordalwayshastwodatabytesandappearsasfollows::02000004FFFFFCwhere:02
此文档下载收益归作者所有