Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All,

I need to convert an INTEL HEXADECIMAL to ascii format.
The data that is got from the Intel hex should be converted with ascii values.

http://forum.allaboutcircuits.com/showthread.php?t=42375[^]


I m looking out for something like this wre d rite hand portion has ascii values.
Can anyone help me with a code?

Thanks in advance.
Posted
Updated 11-Jul-11 0:29am
v3

http://dev.frozeneskimo.com/software_projects/libgis[^]
You can check the C code here https://github.com/vsergeev/libGIS[^]

Try to get the idea and convert it to C#.

Ref:http://en.wikipedia.org/wiki/Intel_hex[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 11-Jul-11 1:39am    
Prerak, how all of this can be relevant? Don't you see the question is gibberish? I answered, don't know why?
--SA
Prerak Patel 11-Jul-11 1:46am    
Intel HEX is a file format, and I guess OP wants to convert those files to human readable format ASCII. I found the link to LibGIS from this wiki link only.
http://en.wikipedia.org/wiki/Intel_hex
Sergey Alexandrovich Kryukov 11-Jul-11 2:01am    
I see. Still gibberish, but 5 for the information.
(will you better add http://en.wikipedia.org/wiki/Intel_hex to the answer? otherwise not clear; I, for example, failed to understand.)
--SA
Prerak Patel 11-Jul-11 2:02am    
Thanks SA.
Manfred Rudolf Bihy 11-Jul-11 6:50am    
5+ For your advanced mindreading capabilities! ;)
No. This "question" is apparent gibberish (see http://en.wikipedia.org/wiki/Gibberish[^]).

There is not such think as INTEL HEXADECIMAL data type of format. Numeric data cannot be hexadecimal or decimal. The whole notion of positional numeral system with certain base is only related to string ("human-readable") representation of numeric data, not to machine representation (which is always "binary"). See http://en.wikipedia.org/wiki/Hexadecimal[^].

Also, data formatted as hexadecimal or decimal cannot be "converted with ASCII values", because in .NET strings are supported in Unicode encoding UTF-16, and ASCII is only related to one of the presentations of data in form of array of byte (in case of ASCII, one byte represents one character, in contrast to all Unicode UTFs) and used in serialization of data written in stream/file.

(Gosh, why am I explaining all that? Who will read it?! I should have simply marked the question as off-topic and explain that this forum is just for software developers.)

[EDIT]

As to the Intel HEX file format, it's already in ASCII. See:
http://en.wikipedia.org/wiki/Intel_hex[^].

Thanks to Prerak who pointed it out and provided the link.

—SA
 
Share this answer
 
v3
Comments
harish85 11-Jul-11 2:01am    
May be OP wants to get the raw data value from intex hex file format..
Sergey Alexandrovich Kryukov 11-Jul-11 2:28am    
Thank you, Harish. Guesswork has never been my favorite game.
--SA
Manfred Rudolf Bihy 11-Jul-11 6:50am    
:) 5+
Sergey Alexandrovich Kryukov 11-Jul-11 10:46am    
Thank you, Manfred.
--SA
harish85 11-Jul-11 12:07pm    
:))
I searched your question and read in a post that "If by "Hex" you mean "Intel Hex", then it already is ASCII! Intel Hex is an ASCII representation of binary data.
(Source http://www.keil.com/forum/9548/[^])
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Jul-11 1:38am    
Not exactly. There is no Intel Hex. Nothing in Intel can be in ASCII, all numeric data is "binary". Please see my answer.
--SA
Member 7979279 11-Jul-11 2:24am    
How did u gave the statement as "There is no INTEL HEX"...? Could you please give me source for that answer...?

If that is correct, then what about the below link...?
http://pages.interlog.com/~speff/usefulinfo/Hexfrmt.pdf

My requirement is to convert the Intel Hex file to Binary file..
When i converted the IntelHEx file using Keil's "HEX2BIN" tool i am getting the same "ASCII" data except all other format bytes as below.

00000000h: 8C C5 97 2B 5C D6 00 00 00 00 93 98 30 00 30 00 ;
00000010h: F5 F2 F0 40 F9 F4 F0 F6 40 40 40 40 40 40 40 40 ;
00000020h: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 ;
00000030h: 00 00 40 00 00 00 10 00 00 00 00 00 00 00 92 98 ;

Is this is a valid BIN file...?

If not, How the data will be represented in a binary file....?

Looking forward to your reply...

Thanks in advance...
Sergey Alexandrovich Kryukov 11-Jul-11 2:33am    
No, no, my mistake. Prerak has shown what is it. Please see my updated answer, after [EDIT].
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900