need helpconvert PIC mcu hex file into C-languag

ErnieM

Joined Apr 24, 2011
8,377
It's theoretically possible, not so in any practical way.

You either need to learn programming in C and write your own code, or if this is your own code then you need to take better care of your source.
 

mitko89

Joined Sep 20, 2012
127
You can turn the hex into assembly, but the resulting assembly code will be close to impossible to understand (all the variable, labels will be changed with names that give you no information as well as there will be no comments). I have never searched or needed an Assy to C converter...
 

MrChips

Joined Oct 2, 2009
30,808
Sounds like someone attempting to reverse engineer code or trying to copy and modify another's intellectual property. Good luck!
 

mitko89

Joined Sep 20, 2012
127
If you try to build the project from sketch it would be much easier and educational. I once tried to reverse engineer the source code for a welding controller... It took me 2 days to get annoyed and few hours to do it myself...
 

Papabravo

Joined Feb 24, 2006
21,225
In a career spanning a half century, I've had occasion to disassemble a program exactly once. It was both educational and practical. The CP/M operating system had a debugger and disassembler that was based on the Intel 8085 chip. When run on a Z80 it worked fine but it would not disassemble Z80 opcodes. I recreated the assembly language source from the running program and modified it to my needs.

In my estimation your chances of recreating C from hex are as close to nil as it is possible to get.
 

mitko89

Joined Sep 20, 2012
127
@Papabravo You sir, are by long shot better than me at this for sure. I only wanted to imply that converting from lower to higher level is quite troublesome (the only conclusion I could get myself). I didn't assert it's not educational or practical, but in order to be able to deal with that, for sure more than basic knowledge is required.
 

Papabravo

Joined Feb 24, 2006
21,225
@Papabravo You sir, are by long shot better than me at this for sure. I only wanted to imply that converting from lower to higher level is quite troublesome (the only conclusion I could get myself). I didn't assert it's not educational or practical, but in order to be able to deal with that, for sure more than basic knowledge is required.
We're both on the same page on this one. This task also took the better part of my summer on unemployment in 1982. This was not a one or two day knock it off in a flash type project.

The only weekend project (cs.1968) I can remember in that same half century career was working for a time sharing company and being handed an inch thick stack of handwritten paper on Monday morning written by Ed Yourden who was a consultant. It was an assembler for a PDP-8 minicomputer written in assembly language for an SDS-940. My job was to key it in on an ASR-33 teletype and get it working. It was done by Friday.
 

mitko89

Joined Sep 20, 2012
127
@Papabravo I had to google the names of the machines you mentioned. I feel both impressed and depressed as reading about your work. I am about to get my MA in Electronics in 2 months yet I realize my knowledge and abilities are close to nothing compared to these of those before me.
 
Top