Convert PIC code from Assembly language to C/C++

Thread Starter

RG23

Joined Dec 6, 2010
304
I need to convert PIC code from Assembly language to C/C++.

Please let me know the correct approach

Thanks
 

Papabravo

Joined Feb 24, 2006
15,092
The correct approach is:
  1. Understand the assembly language program
  2. Implement the functionality in C .OR.
  3. Implement the functionality in C++
AFAIK there is no automated way to do this.
 

Thread Starter

RG23

Joined Dec 6, 2010
304
I am using mikroC PRO for PIC from Mikroelektronika

PIC18f67J90

Initially I used MPLAB IDE

The code works fine there

Will converting to C also help me to reduce the memory gauge?

Also if anyone has an example from assembly to c/C++ please let me know

Thanks
 

Thread Starter

RG23

Joined Dec 6, 2010
304
The correct approach is:
  1. Understand the assembly language program
  2. Implement the functionality in C .OR.
  3. Implement the functionality in C++
I have written the code in assembly language so check step1

I need to know how to implement in C/C++
 

takao21203

Joined Apr 28, 2012
3,695
Pretty unlikely unless the assembly code is badly written.
It is easier to modify C in terms of saving memory space.
Some algorithm can be replaced with a better one...

OP should give the source code in question, or at least, parts of it, so members here can give an estimate. It's not totally needed to show the complete source.
 
Convert very carefully and possibly one subroutine/function at a time and check it.

I converted 300,000 lines of PC assembler into Delphi and took that approach.
I still had one or two bugs but got there in the end.
 
Top