tcl指令碼實現hex檔案生成bin檔案

2021-09-24 12:07:25 字數 520 閱讀 7396

hex檔案的格式說明:

**如下:

proc hextobin   

close $fp;

puts $data(0);

set sum 0;#二進位制檔案總長度

set index 0;

set outdata "";

#不考慮順序和位址

while

} incr index;

} puts $sum;

#生成bin檔案

set filename "h:/bin.bin";

set fp [open $filename w];

fconfigure $fp -translation binary

puts -nonewline $fp $outdata;

close $fp;

}

待優化:

位址亂序處理

知識點:

hex檔案格式

tcl二進位制檔案操作

檔案操作示例指令碼 tcl

linux 下,經常會對用到檔案操作,下面是乙個用 tcl 寫的檔案操作示例指令碼 其中 set f01 open fix.tcl w 命令表示 開啟或者新建乙個檔案 fix.tcl 並將其 file id 設定為 f01,後續就以這個 file id 來操作這個檔案 然後 puts f01 siz...

實現BIN檔案資料讀取的TCL指令碼分析

需要需要設定檔案及路徑 set openfile c program files jtagnet runbin s2k000071v1.jtg eeprom.bin 開啟檔案 set fl open openfile puts open file openfile 配置檔案資料讀入格式 fconfi...

解讀keil生成的hex檔案 小V

keil arm公司收購的整合微控制器的編譯鏈結等一系列工具的開發環境,支援c和彙編程式設計。經常燒錄keil生成的hex檔案,不免想知道其資料組成,以下為使用keil 4結合網上和自身的使用,解讀一下。使用keil c51,即大端格式 請使用小端編譯的自行轉換 keil hex檔案是由一行行符合i...