How to convert (*.asm;*.lst & *.hex) to "C" program

takao21203

Joined Apr 28, 2012
3,702
sir,( to all the above )
thanks for all you have suggested ;
I have an idea but don't know how to implement it some thing like Reverse Engineering

eg.:-

"C" Language code's converted to the BINARY Language code's With the help of C Compiler (Like Dev C++ / Keil μVer 4 "C" code's converted to Binary Code's)

And

"ASM" Language Code's converted to the Binary Language Code's with the help of " 'ASM' Compiler ( like " ASM51 " ASSEMBLY Language code's converted to Binary Code's ( may be I don't know))

Now

can we convert that HEX => Binary code's to Binary => "C" code's.

if yes how?
The fact it seems to be so much intellectually demanding to write programs, I am tempted to look at this whole thing again.

I have indeed learned C language. If you know assembler its not difficult, just a different way of spelling and you basically dont need the opcodes.

To translate ASM to C is not good, rather program in C genuinely.

C is hardware independent all the same for the small 8bit ICs.
Assembler is different for each and a phlethora to remember all and so easy to have bugs creep in,
need to do basic things manually, only have 8bit natively and so on.

You could actually code the C script with any IDE, MPLABX is good since you have a simulator and is free, later port to specific IC.

You need to understand properly memory, array, pointer, bits, ALU operation, allocation, include files.
If not maybe it can be kind of a learning experience but you will be stuck all the time.

IT is possible to try convert ASM to C almost 1:1 but not the easiest or best way, in C your not as much bound, it might be slower
and taking more memory in the end but that doesnt really count anymore.

Write the whole thing in C from scratch, using MPLABX with simulator, look at tasks definition, then port to the IC youre going to use.

So the guru would use include files, functions for the IO.
This is how petitfs is done, to use the FAT32 SD card, can compile on almost any 8bit IC, only
needs a few modifications for hardware IO.

you would need a few years and some 100 programs to learn this technology, but worth to think about this when you program.
Make it hardware independent and portable as much as possible.
 

takao21203

Joined Apr 28, 2012
3,702
Also quite staggering efforts to try understand what each opcode does some chips have more than 100,
so almost only an expert for the particular can deal with it.

Others simply can not read your code, dont have hours floating around to learn the opcodes.

One of the main reasons why assembler is pretty much pout of fashion, and why everyone is using C.

I did use assembler but after some while discussing a complicate 18F program with others didnt work out because they couldnt read the opcodes, all this painful RISC where you need several lines , where as for the CISC kinds you only need one, I went through it and finally abandoned it, after some years, difficult to read code even if I wrote it myself.

Not really good to find bugs either and they do creep in if you use libraries and write larger programs, inevitably.
 
The fact it seems to be so much intellectually demanding to write programs, I am tempted to look at this whole thing again.

I have indeed learned C language. If you know assembler its not difficult, just a different way of spelling and you basically dont need the opcodes.

To translate ASM to C is not good, rather program in C genuinely.

C is hardware independent all the same for the small 8bit ICs.
Assembler is different for each and a phlethora to remember all and so easy to have bugs creep in,
need to do basic things manually, only have 8bit natively and so on.

You could actually code the C script with any IDE, MPLABX is good since you have a simulator and is free, later port to specific IC.

You need to understand properly memory, array, pointer, bits, ALU operation, allocation, include files.
If not maybe it can be kind of a learning experience but you will be stuck all the time.

IT is possible to try convert ASM to C almost 1:1 but not the easiest or best way, in C your not as much bound, it might be slower
and taking more memory in the end but that doesnt really count anymore.

Write the whole thing in C from scratch, using MPLABX with simulator, look at tasks definition, then port to the IC youre going to use.

So the guru would use include files, functions for the IO.
This is how petitfs is done, to use the FAT32 SD card, can compile on almost any 8bit IC, only
needs a few modifications for hardware IO.

you would need a few years and some 100 programs to learn this technology, but worth to think about this when you program.
Make it hardware independent and portable as much as possible.



we can convert any language to c , it is vey time consuming, need to create manually by reading asm file, unfortunately there is no converter for asm file to c conversion, if done, it may brocken some lines, so do it manually. if you need to convert the file send to us we create the c file and send back to you.
\
and asm file is more seccure and easy to compile with asmide compiler software.
 

nazims

Joined Feb 4, 2017
2
we can convert any language to c , it is vey time consuming, need to create manually by reading asm file, unfortunately there is no converter for asm file to c conversion, if done, it may brocken some lines, so do it manually. if you need to convert the file send to us we create the c file and send back to you.
\
and asm file is more seccure and easy to compile with asmide compiler software.
Hi,I have some HEX files for decompile to "C".My mail address:<SNIP>,want send to you personaly.

Mederators note : Removed email to avoid spam
 
Last edited by a moderator:
Top