eng.abassam
May 13th, 2011, 06:51 AM
can you help me to convert c code to assmbly code PIC18
The following C code finds out the three decimal digits
(A2,A1,A0) corresponding to an 8-bit unsigned integer
An.
A2=0;
do{
An -=100;
if(An>=0) ++A2;
}while(An>=0);
An+=100;
A1=0;
do{
An -=10;
if(An>=0) ++A1;
}while(An>=0);
A0=An+10;
The following C code finds out the three decimal digits
(A2,A1,A0) corresponding to an 8-bit unsigned integer
An.
A2=0;
do{
An -=100;
if(An>=0) ++A2;
}while(An>=0);
An+=100;
A1=0;
do{
An -=10;
if(An>=0) ++A1;
}while(An>=0);
A0=An+10;