Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to check the size of hex file produced by tasm compiler?

Status
Not open for further replies.

garg29

Advanced Member level 1
Joined
Nov 17, 2004
Messages
443
Helped
25
Reputation
50
Reaction score
10
Trophy points
1,298
Activity points
3,593
Size of Hex File

Hi friends,
how can i check the size of a hex file produced by tasm compiler for 89c51. i'm making assembly files in windows xp. if i check the size by right cliking on the file (properties), it shows the size of file much more than what it really is...???

Thanks,
With best regards,
Amit
 

Re: Size of Hex File

peace,
most of hex file generated if you open it by notepad you'll find in the left columns the addresses and then 32 hex No. which indicate date placed
you can see it and find where is the last data written befor filling the rest of ROM by FF or 00

like that
:020000040000FA (header)
:100000000263BAC0D075D00802C0B1C0D075D008A4
:100010000276E47F0212B887EF1322C0D075D008B1
:10002000027C99788BA6057B8B8F1C7D017F8A12C1
:100030003AD82202B5B3536F756E6400566F6C7573
:100040006D650042616C616E636500547265626C3F
:10005000650042617373004566666563740053759D
.
.
.
.
.:10CB30005D22A25B22A25D22D25E22A25122AFC15F
:10CB400022AFC422AFC522AFC6228FC1228FC4221A
:10CB50008FC5228FC622D3220F22222222222222F6
:10CB6000222222FFFFFFFFFFFFFFFFFFFFFFFFFF6C
:10CB7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5
:10CB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5
:10CB9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5
:10CBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95
:

you can know now what is the last address and knew from it size of ROM code.

Salam
 

Re: Size of Hex File

An Intel HEX file is composed of any number of HEX records. Each record is
made up of five fields that are arranged in the following format:

:llaaaatt[dd...]cc

Each group of letters corresponds to a different field, and each letter represents a
single hexadecimal digit. Each field is composed of at least two hexadecimal
digits—which make up a byte—as described below:

: is the colon that starts every Intel 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 8086 segment address record.
04 extended linear address record.

dd is a data field that represents one byte of data. A record may have multiple data bytes. The number of data bytes in the record must match the number specified by the ll field.

cc is the checksum field that represents the checksum of the record. The checksum is calculated by summing the values of all hexadecimal digit pairs in the record modulo 256 and taking the two’s complement.
 

Re: Size of Hex File

convert it to a binary format and check the size of the bin file. Here you can download a free HEX2BIN converter tool:
https://www.keil.com/download/files/hex2bin.zip

Btw. the ROM-size can usually be found in a map-file...


Mik
 

Re: Size of Hex File

So much of info on Hex file formats is given. So it is very clear actual ROM size is much lesser than HEX file size. As each byte is framed by 2 characters. each line consists on around 8 bytes (4bytes address, start :)) 1 byte, type of record 1 byte, length of record 1 byte, check sum 1byte) of overhead.

between, BIN file also wont give the correct size if the there is spaces in between.
The only best way to find the ROM size is checking the MAP file

Cheers
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top