Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Can someone covert this 'C' code to 'ASM' code ?

The code is for use as a temperature control system where the temperature is displayed on a lcd display using a lm35 and an 8051 chip. Any help on this would be greatly appreciated, thanks in advance.

[code]
#include
#define ldata P2
#define temp P1
sbit r= P3^3; // Write pin. It is used to start the conversion.
sbit d= P3^4; // Read pin. It is used to extract the data from internal register to the output pins of ADC.
sbit rs = P3^0; //register select pin
sbit rw = P3^1; // read write pin
sbit en = P3^2; //enable pin
void lcdcmd (unsigned char value);
void lcddata (unsigned char value);
void lcddata1 (unsigned char value);
void delay(unsigned int msec ) // The delay function provides delay in msec.
{
int i,j ;
for(i=0;i<msec;i++)
for(j=0; j<1275; j++);
}

void main()
{
signed int a,b,c;
while(1)
{
d=1;
r=0;
delay(1);
r=1;
delay(1);
d=0;
delay(1);
lcdcmd (0x38);
delay (1);
lcdcmd (0x0C);
delay (1);
lcdcmd (0x80);
delay (1);
lcddata ('T');
delay (1);
lcddata ('E');
delay (1);
lcddata ('M');
delay (1);
lcddata ('P');
delay (1);
lcddata (':');
delay (1);
lcddata ('-');
delay (1);
c=temp/100;
lcddata1(c);
delay (1);
a=(temp/10)-(c*10);
lcddata1(a);
delay (1);
b=temp%10;
lcddata1(b);
delay (1);
}
}
void lcdcmd (unsigned char value)
{
ldata =value;
rs=0;
rw=0;
en=1;
delay (1);
en=0;
return;
}
void lcddata1 (unsigned char value)
{
value=value+0x30;
ldata =value;
rs=1;
rw=0;
en=1;
delay (1);
en=0;
return;
}
void lcddata (unsigned char value)
{
ldata =value;
rs=1;
rw=0;
en=1;
delay (1);
en=0;
return;
}
[/code]
Sign In or Register to comment.