Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Convert assembly to c language! HELP NEEDED PLEASE

Status
Not open for further replies.

shobhit12345

New Member
i REALLy need to convert this assembly file to c language file,if anyone can..please help me out...it will be a huge favour.
 
What you're asking is not possible, ASM can't be converted to C, at least none of it will make any kind of sense to a human being.
 
What you're asking is not possible, ASM can't be converted to C, at least none of it will make any kind of sense to a human being.

I think you are taking this way too literally.

It's not going to be auto-translated and it's not going to be rewritten in C to give the exact same HEX output, but it's not a large program. It looks like it could be rewritten in C without too much difficulty. I'm not fluent in PIC assembler, but I'd give it a try if I was. Just a simple RGB LED fading program.

Seems like it would be easier to just write it from scratch, though.
 
I think you are taking this way too literally.

It's not going to be auto-translated and it's not going to be rewritten in C to give the exact same HEX output, but it's not a large program. It looks like it could be rewritten in C without too much difficulty. I'm not fluent in PIC assembler, but I'd give it a try if I was. Just a simple RGB LED fading program.

Seems like it would be easier to just write it from scratch, though.

I agree... The trouble with converting that code is..Its messy!! its easier to see what's being done and write it in C.... It's time consuming... It took me quite a while to convert Nigel's asm code into C. But his code was well written!!
 
It's not way to literal at all, I'm responding to the words the poster used, this in the Internet, you can't assume intention from a handful of poorly chosen words, there are too many cultures involved be it slight difference from state to state, from country to country, or from continent to continent.
 
Last edited:
I'm afraid I don't understand your response either. The OP's request didn't seem ambiguous to me. While some assembly language programs might be difficult or impossible to convert to C for reasons of efficiency and performance, not all assembly language programs would be impossible to convert to C. I do agree with Ian though that, depending on the assembly language program, it might be difficult to justify the time and effort required to convert any particular program to C.

Speaking of ambiguous (grin), are you located in Rochester, MI., Rochester, MN., Rochester, NY., etc.?

Regards...
 
Last edited:
Then, why have I not seen a response that is the C equivocation of the original posters ASM yet?

I stand by my original statement.


Mike, it's Rochester, Ny.
 
What you're asking is not possible, ASM can't be converted to C, at least none of it will make any kind of sense to a human being.

When I converted all 14 tutorials..... It was relatively easy, going from asm to C isn't the issue, I converted them because there was a good reason to... The boards are easily made and like I said the code was well commented....

I wouldn't do it again because it took about three days each.... not just the conversion... the debugging afterwards.
 
Perhaps the OP should've said "Translate assembly to C language". But I do agree...seems Scead is just trying to overcomplicate the matter.

However...if the assembly language version works, what would be the point of translating it to C?
 
There are C-decompilers for executable files, but there's hardly gonna be any of them able a MPLAB .hex file

I've used Rec Studio 4 and it did well the job, though the C code was all messy.

Maybe you could put an adapted code, so it would be the same but for an executable file and later you could decompile it in a similar C code as the one needed for MPLAB so you could adapt it to the one MPLAB needs.

Hope it helps.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top