home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / keyboard / keyutils.arc / READKEY.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-09-05  |  734 b   |  21 lines

  1. public readkey
  2. code           segment byte public 'code'
  3.                assume cs:code
  4. readkey        proc
  5.                xor     ax,ax           ; read key
  6.                int     16h
  7.                cmp     al,0            ; extended code?
  8.                je      ext_code
  9.                cmp     ah,0            ; entered by alt_key
  10.                je      alt_key
  11.                xor     ah,ah           ; knock of scan code
  12.                jmp     short   done
  13. ext_code:      xchg    ah,al           ; put scan code in al
  14.                add     ax,1000         ; add 1000
  15.                jmp     short done
  16. alt_key:       add     ax,2000
  17. done:          ret
  18. readkey        endp
  19. code           ends
  20.                end
  21.