Apr 22, 2006 #1 A 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.
Apr 22, 2006 #2 I IanP Advanced Member level 7 Joined Oct 5, 2004 Messages 7,929 Helped 2,311 Reputation 4,624 Reaction score 531 Trophy points 1,393 Location West Coast Activity points 66,416 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
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
Apr 22, 2006 #3 Davood Amerion Advanced Member level 2 Joined Mar 1, 2005 Messages 579 Helped 116 Reputation 232 Reaction score 24 Trophy points 1,298 Location Persia Activity points 6,345 This is C source code for getkey for C51 #include <reg51.h> char _getkey () { char c; while (!RI); c = SBUF; RI = 0; return (c); } Click to expand... you can comile it and generate its assemly source code or translate it to assembly by yourself line by line!
This is C source code for getkey for C51 #include <reg51.h> char _getkey () { char c; while (!RI); c = SBUF; RI = 0; return (c); } Click to expand... you can comile it and generate its assemly source code or translate it to assembly by yourself line by line!