home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 September / PCWK996.iso / demo / wgelectr / pk51demo / files.2 / EXAMPLES / SAMPL517 / GETKEY.C < prev    next >
C/C++ Source or Header  |  1995-06-08  |  1KB  |  28 lines

  1. /***********************************************************************/
  2. /* Copyright 1995 KEIL Software, Inc.                                  */
  3. /***********************************************************************/
  4. /*                                                                     */
  5. /*  PUTCHAR.C:  This routine is the general character input of C51.    */
  6. /*                                                                     */
  7. /*  To translate this file use C51 with the following invocation:      */
  8. /*                                                                     */
  9. /*     C51 GETKEY.C                                                    */
  10. /*                                                                     */
  11. /*  To link the modified GETKEY.OBJ file to your application use the   */
  12. /*  following BL51 invocation:                                         */
  13. /*                                                                     */
  14. /*     BL51 <your object file list>, GETKEY.OBJ <controls>             */
  15. /*                                                                     */
  16. /***********************************************************************/
  17.  
  18. #include <reg517.h>
  19.  
  20. char _getkey ()  {
  21.   char c;
  22.  
  23.   while (!(S1CON & 0x01));
  24.   c = S1BUF;
  25.   S1CON &= 0xFE;   /* RI = 0 */
  26.   return (c);
  27. }
  28.