sign up
Newbie level 6

Hi, any software to convert assembly to c language?
or any software to convert c language to assembly?
please recommend to me if you know. thx.
below are two program written in c.language.
anyone can help me to convert these into assembly language for pic16f?
Thanks!!:grin:
PROGRAM 1:
#include<htc.h>
__CONFIG(0x3f71);
const unsigned char sevensegment[]={0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000010,0b11111000,0b10000000,0b10010000};
void main(void)
{
unsigned int index=1,b=0,c=0;
unsigned char a;
TRISC=0xff;
TRISB=0x00;
TRISD=0x00;
while(1)
{
PORTD=sevensegment[a];
PORTB=sevensegment[0];
for(;index<=10-1
{
if(RC0==1)
{
for(;c==1
{
index++;
c=0;
}
PORTB=sevensegment[index];
index++;
while(RC0==1)
continue;
b=0;
}
else if(RC1==1)
{
for(;b==0
{
index--;
b=1;
}
index--;
PORTB=sevensegment[index];
while(RC1==1)
continue;
c=1;
}
}
while(RC0==0)
continue;
a++;
index=0;
}
}
PROGRAM2:
#include<htc.h>
__CONFIG(0x3f71);
const unsigned char sevensegment[]={0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000010,0b11111000,0b10000000,0b10010000};
void main(void)
{
unsigned index=1;
unsigned char a;
TRISC=0xff;
TRISB=0x00;
TRISD=0x00;
while(1)
{
for(;index<=10-1
{
if(RC0==1)
{
PORTB=sevensegment[index];
index++;
while(RC0==1)
continue;
}
else if(RC1==1)
{
index--;
PORTB=sevensegment[index];
while(RC1==1)
continue;
}
}
index=0;
}
}
or any software to convert c language to assembly?
please recommend to me if you know. thx.
below are two program written in c.language.
anyone can help me to convert these into assembly language for pic16f?
Thanks!!:grin:
PROGRAM 1:
#include<htc.h>
__CONFIG(0x3f71);
const unsigned char sevensegment[]={0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000010,0b11111000,0b10000000,0b10010000};
void main(void)
{
unsigned int index=1,b=0,c=0;
unsigned char a;
TRISC=0xff;
TRISB=0x00;
TRISD=0x00;
while(1)
{
PORTD=sevensegment[a];
PORTB=sevensegment[0];
for(;index<=10-1
{
if(RC0==1)
{
for(;c==1
{
index++;
c=0;
}
PORTB=sevensegment[index];
index++;
while(RC0==1)
continue;
b=0;
}
else if(RC1==1)
{
for(;b==0
{
index--;
b=1;
}
index--;
PORTB=sevensegment[index];
while(RC1==1)
continue;
c=1;
}
}
while(RC0==0)
continue;
a++;
index=0;
}
}
PROGRAM2:
#include<htc.h>
__CONFIG(0x3f71);
const unsigned char sevensegment[]={0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000010,0b11111000,0b10000000,0b10010000};
void main(void)
{
unsigned index=1;
unsigned char a;
TRISC=0xff;
TRISB=0x00;
TRISD=0x00;
while(1)
{
for(;index<=10-1
{
if(RC0==1)
{
PORTB=sevensegment[index];
index++;
while(RC0==1)
continue;
}
else if(RC1==1)
{
index--;
PORTB=sevensegment[index];
while(RC1==1)
continue;
}
}
index=0;
}
}