Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

combining c51 and assembly in a single source code

Status
Not open for further replies.

Abhishek Saurabh

Newbie level 1
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top