File: rawgetc.asm

package info (click to toggle)
ng 1.5~beta1-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,144 kB
  • sloc: ansic: 43,437; asm: 3,150; sh: 2,539; cpp: 1,234; makefile: 577
file content (94 lines) | stat: -rw-r--r-- 1,923 bytes parent folder | download | duplicates (10)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
; $Id: rawgetc.asm,v 1.1.1.1 2000/06/27 01:47:58 amura Exp $
;
;	int rawgetc();	Get one char from keyboard. If no keyin, return -1.
;
;	1990.02.11	Created by S.Yoshida.
;			With original idea from K.Takano.
;	1990.03.15	Modified for C-SPC by K.Takano & S.Yoshida
;	1990.03.31	Modified for Turbo-C by A.Shirahashi
;
;	A> masm [-DPC9801|-DIBMPC] -Mx rawgetc.asm,rawgetc.obj,nul,nul
;
; $Log: rawgetc.asm,v $
; Revision 1.1.1.1  2000/06/27 01:47:58  amura
; import to CVS
; 

;		(from)		1990.03.31  by A.Shirahashi
RAWGETC_TEXT	segment	byte public 'CODE'
DGROUP	group	_DATA,_BSS
	assume	cs:RAWGETC_TEXT,ds:DGROUP
RAWGETC_TEXT	ends
_DATA	segment word public 'DATA'
d@	label	byte
d@w	label	word
_DATA	ends
_BSS	segment word public 'BSS'
b@	label	byte
b@w	label	word
_BSS	ends
RAWGETC_TEXT	segment	byte public 'CODE'
_rawgetc	proc	far
;		(to)		1990.03.31  by A.Shirahashi

		mov	ah, 06h
		mov	dl, 0ffh
		int     21h
		mov	ah, 0
		jnz	L1
		mov	ax, -1

		ifdef	PC9801	; 1990.03.15  by K.Takano
		jmp	short done

L1:		cmp	al, ' '
		jne	done
		mov	ah, 02h
		int	18h
		and	ax, 0010h
		xor	al, 10h
		shl	al, 1
done:
;		(from)		1991.06.02  by Y.Koyanagi
		push	ax
		mov	ax, 040ah
		int	18h
		and	ah, 02h	; NFER key
		pop	ax
		jz	L2
		or	ax, 0100h ; METABIT
L2:
;		(to)		1991.06.02  by Y.Koyanagi
		endif		; 1990.03.15  by K.Takano

		ifdef	IBMPC	; 1990.03.15  by S.Yoshida
		jmp	short done

L1:		cmp	al, ' '
		jne	done
		mov	ah, 02h
		int	16h
		and	ax, 0004h
		xor	al, 04h
		jz	done
		mov	al, ' '
done:
		endif		; 1990.03.15  by S.Yoshida.

;		(from)		1990.03.31  by A.Shirahashi
		ifndef PC9801
		ifndef IBMPC
L1:
		endif
		endif
		ret
_rawgetc	endp
RAWGETC_TEXT	ends
_DATA	segment word public 'DATA'
s@	label	byte
_DATA	ends
RAWGETC_TEXT	segment	byte public 'CODE'
RAWGETC_TEXT	ends
	public	_rawgetc
		end
;		(to)		1990.03.31  by A.Shirahashi