unix2doc

unix2doc
perl
-i -p -e 's/\n/\r\n/' file sed -i -e 's/$/\r/' file

doc2unix
tr -d '\r' < file > file2
perl -i -p -e 's/\r//' file
sed -i -e 's/\r//' file

packihx 应该是使用在unix平台, 我用packihx出来的结果就是 换行少了‘\r’ 末尾少了‘\n’
于是用这个处理。


Intel的hex文件

1 each Line in an Intel HEX caontains one HEX record.
一般用于transfer程序

2 record format
each record is made up of five fields that are arranged in the following format:
:llaaaatt[dd...]cc

':' is the colon that starts every Intek HEX record.
'll' is the record-length field that represents the number of data bytes(dd) in the record.
'aaaa' is the address field that represents the starting address for subsequent data in the record.
'tt' is the field that represents the HEX record type, which may be one of the following:
  00 -- data record
  01 -- end-of-file record
  02 -- extended segment address record
  04 -- extended linear address record
'dd' is a data filed taht represents one byte of data.
'cc' is the checksum field  taht represents the checksum of the record. the checksum is calculated by summing the values
of all hexadecimal digit pairs in the record module 255 and taking the two's complement.(加,取反加1)


posted on 2013-08-24 16:57  kwingmei  阅读(515)  评论(0编辑  收藏  举报

导航