Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Cprogram convert to pic16 assembly language

Status
Not open for further replies.

sign up

Newbie level 6
Joined
May 13, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,385
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;

}
}
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top