下载

1下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 Intel HEX文件格式

Intel HEX文件格式.pdf

Intel HEX文件格式

聆听黑暗1404183207
2010-08-14 0人阅读 举报 0 0 暂无简介

简介:本文档为《Intel HEX文件格式pdf》,可适用于IT/计算机领域

QUESTIONWhatistheIntelHEXfileformatANSWERTheIntelHEXfileisanASCIItextfilewithlinesoftextthatfollowtheIntelHEXfileformatEachlineinanIntelHEXfilecontainsoneHEXrecordTheserecordsaremadeupofhexadecimalnumbersthatrepresentmachinelanguagecodeandorconstantdataIntelHEXfilesareoftenusedtotransfertheprogramanddatathatwouldbestoredinaROMorEPROMMostEPROMprogrammersoremulatorscanuseIntelHEXfilesRecordFormatAnIntelHEXfileiscomposedofanynumberofHEXrecordsEachrecordismadeupoffivefieldsthatarearrangedinthefollowingformat::llaaaattddccEachgroupofletterscorrespondstoadifferentfield,andeachletterrepresentsasinglehexadecimaldigitEachfieldiscomposedofatleasttwohexadecimaldigitswhichmakeupabyteasdescribedbelow::isthecolonthatstartseveryIntelHEXrecordllistherecordlengthfieldthatrepresentsthenumberofdatabytes(dd)intherecordaaaaistheaddressfieldthatrepresentsthestartingaddressforsubsequentdataintherecordttisthefieldthatrepresentstheHEXrecordtype,whichmaybeoneofthefollowing:datarecordendoffilerecordextendedsegmentaddressrecordextendedlinearaddressrecordddisadatafieldthatrepresentsonebyteofdataArecordmayhavemultipledatabytesThenumberofdatabytesintherecordmustmatchthenumberspecifiedbythellfieldccisthechecksumfieldthatrepresentsthechecksumoftherecordThechecksumiscalculatedbysummingthevaluesofallhexadecimaldigitpairsintherecordmoduloandtakingthetwo'scomplementDataRecordsTheIntelHEXfileismadeupofanynumberofdatarecordsthatareterminatedwithacarriagereturnandalinefeedDatarecordsappearasfollows::CFCCwhere:isthenumberofdatabytesintherecordistheaddresswherethedataaretobelocatedinmemoryistherecordtype(adatarecord)CCisthedataisthechecksumoftherecordExtendedLinearAddressRecords(HEX)ExtendedlinearaddressrecordsarealsoknownasbitaddressrecordsandHEXrecordsTheserecordscontaintheupperbits(bits)ofthedataaddressTheextendedlinearaddressrecordalwayshastwodatabytesandappearsasfollows::FFFFFCwhere:isthenumberofdatabytesintherecordistheaddressfieldFortheextendedlinearaddressrecord,thisfieldisalwaysistherecordtype(anextendedlinearaddressrecord)FFFFistheupperbitsoftheaddressFCisthechecksumoftherecordandiscalculatedashNOT(hhhhFFhFFh)Whenanextendedlinearaddressrecordisread,theextendedlinearaddressstoredinthedatafieldissavedandisappliedtosubsequentrecordsreadfromtheIntelHEXfileThelinearaddressremainseffectiveuntilchangedbyanotherextendedaddressrecordTheabsolutememoryaddressofadatarecordisobtainedbyaddingtheaddressfieldintherecordtotheshiftedaddressdatafromtheextendedlinearaddressrecordThefollowingexampleillustratesthisprocessAddressfromthedatarecord'saddressfieldExtendedlinearaddressrecorddatafieldFFFFAbsolutememoryaddressFFFFExtendedSegmentAddressRecords(HEX)ExtendedsegmentaddressrecordsalsoknownasHEXrecordscontainbitsofthedataaddresssegmentTheextendedsegmentaddressrecordalwayshastwodatabytesandappearsasfollows::EAwhere:isthenumberofdatabytesintherecordistheaddressfieldFortheextendedsegmentaddressrecord,thisfieldisalwaysistherecordtype(anextendedsegmentaddressrecord)isthesegmentoftheaddressEAisthechecksumoftherecordandiscalculatedashNOT(hhhhhh)Whenanextendedsegmentaddressrecordisread,theextendedsegmentaddressstoredinthedatafieldissavedandisappliedtosubsequentrecordsreadfromtheIntelHEXfileThesegmentaddressremainseffectiveuntilchangedbyanotherextendedaddressrecordTheabsolutememoryaddressofadatarecordisobtainedbyaddingtheaddressfieldintherecordtotheshiftedaddressdatafromtheextendedsegmentaddressrecordThefollowingexampleillustratesthisprocessAddressfromthedatarecord'saddressfieldExtendedsegmentaddressrecorddatafieldAbsolutememoryaddressEndofFile(EOF)RecordsAnIntelHEXfilemustendwithanendoffile(EOF)recordThisrecordmusthavethevalueintherecordtypefieldAnEOFrecordalwaysappearsasfollows::FFwhere:isthenumberofdatabytesintherecordistheaddresswherethedataaretobelocatedinmemoryTheaddressinendoffilerecordsismeaninglessandisignoredAnaddressofhistypicalistherecordtype(anendoffilerecord)FFisthechecksumoftherecordandiscalculatedashNOT(hhhh)ExampleIntelHEXFileFollowingisanexampleofacompleteIntelHEXfile::ACADAEAFFEEFF:EBDFEACF:D:CFEFDFDD:FEFFDFAFFEDCFCEAEFEECF:FAEFECB:FFHex文件的INTEL格式:这是Intel公司提出的按地址排列的数据信息,数据宽度为字节,所有数据使用进制数字表示这是一个例子::AFFFECFAC:CBEACAFEDAAD:BAFAFCACB:FF第一行,":"符号表明记录的开始后面的两个字符表明记录的长度,这里是h后面的四个字符给出调入的地址,这里是h后面的两个字符表明记录的类型数据记录记录文件结束扩展段地址记录开始段地址记录扩展线性地址记录开始线性地址记录后面则是真正的数据记录,最后两位是校验和检查,它加上前面所有的数据和为最后一行特殊,总是写成这个样子扩展IntelHex的格式(最大M):由于普通的Intel的Hex记录文件只能记录K的地址范围,所以大于K的地址数据要靠扩展IntelHex格式的文件来记录对于扩展形式Hex文件,在每一个K段的开始加上扩展的段地址规定,下面的数据地址均在这个段内,除非出现新的段地址定义一个段地址定义的格式如下:起始符长度起始地址扩展段标示扩展段序号无用累加和:EC段地址的标识符是第四组数据,表示扩展地址段的定义,再后面的以为HEX数表示段的数目,上面的定义为,表示段地址是,所以下面的数据地址是XX(XX是K段内的地址)

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/4

Intel HEX文件格式

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利