Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getkey.s « go32 « sys « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d70a275906dbfff298a5d046731659dddc2fc5c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* This is file GETKEY.S */
/*
** Copyright (C) 1993 DJ Delorie
**
** This file is distributed under the terms listed in the document
** "copying.dj".
** A copy of "copying.dj" should accompany this file; if not, a copy
** should be available from where this file was obtained.  This file
** may not be distributed without a verbatim copy of "copying.dj".
**
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005

Changed handling of characters starting with 0xE0:
	Now calls interrupt 16, function 10
	if leading byte was 0x00, ah = 0x01
	if leading byte was 0xE0, ah = 0x02

	The main function is now called getxkey()...
	getkey is provided to maintain compatibility with
	already written software
*/

	.globl	_getxkey
_getxkey:
	pushl	%ebx
	pushl	%esi
	pushl	%edi
	movb	$0x10,%ah
	int	$0x16
	mov	$1,%bl
	cmpb	$0,%al
	je	L0
	cmpb	$0xE0,%al
	jne	L1
	inc	%bl
L0:
	movb	%ah,%al
	movb	%bl,%ah
	jmp	L2
L1:
	movb	$0,%ah
L2:
	andl	$0xffff,%eax
	popl	%edi
	popl	%esi
	popl	%ebx
	ret

	.globl	_getkey
_getkey:
	call	_getxkey
	testb	$0x02,%ah
	jz	L3
	movb	$0x01,%ah
L3:
	ret