home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / GNU_ATP_1_40.lzh / EDITLINE / getch.s < prev    next >
Text File  |  1993-05-01  |  1KB  |  45 lines

  1. /* This file is derived from lib file GETKEY.S */
  2. /*
  3. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15. /* this file is used to interface the Rich Salz editline library 
  16.    with D.J.Delore's GCC for MS-DOS. It could be used with other
  17.    DOS C compilers that need the getch() function which gets raw
  18.    keys strokes without buffering or translating.
  19. */
  20.  
  21. /* int getch( void ) ; */ 
  22.  
  23.     .globl    _getch
  24. _getch:
  25.     pushl    %ebx
  26.     pushl    %esi
  27.     pushl    %edi
  28.     movb    $0x10,%ah
  29.     int    $0x16
  30.     cmpb    $0xe0,%al
  31.         je      L2
  32.     cmpb    $0,%al
  33.     jne    L1
  34.         movb    $0xe0,%al
  35.         jmp     L2
  36. L1:
  37.     movb    $0,%ah
  38. L2:
  39.     andl    $0xffff,%eax
  40.     popl    %edi
  41.     popl    %esi
  42.     popl    %ebx
  43.     ret
  44.  
  45.