combining c51 and assembly in a single source code

Status
Not open for further replies.

Abhishek Saurabh

Newbie level 1
Joined
Apr 22, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
what is the alternative in c51 for the function getkey() in assembly.
 

Try this sequence:

JNB RI,$ ;Wait for the 8051 to set the RI flag
MOV A,SBUF ;Read the character from the serial port

Regards,
IanP
 

This is C source code for getkey for C51
#include <reg51.h>

char _getkey () {
char c;

while (!RI);
c = SBUF;
RI = 0;
return (c);
}

you can comile it and generate its assemly source code
or translate it to assembly by yourself line by line!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…