head	1.1;
access;
symbols;
locks
	yap:1.1; strict;
comment	@# @;


1.1
date	97.12.04.16.21.47;	author yap;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@<html>
<title>
V22.0201, Machine Organization I, Yap:
Notes on Keyboard
</title>
<body bgcolor="EEEEEE">

<h4><font color=AA0000> <center>
<a name=top>
V22.0201.002, Machine Organization I <br>
Fall 1997
</a>
</center></font> </h4>

<img src="http://cs.nyu.edu/~yap/gifs/lines/rainbowline.gif">

<h3><font color=AA00AA> <center>
	NOTES ON KEYBOARD
</center></font> </h3>

	This supplements the notes in chap.12 of textbook.

<p>
<hr>

<!--
<h3><font color=AA00AA>
CONTENTS
</font></h3>
<ul>
<li> <a href=#intro>Introduction</a>
<li> <a href=#msetable>Table of Mouse Interrupt Functions (INT 33h) </a>
<li> <a href=#cursor>Mouse Cursor</a>
<li> <a href=#bot>Bottom of page</a>
</ul>

<p>
<hr>

-->

<h3><font color=AA00AA>
<a href=#intro>
INTRODUCTION  
</a>
</font></h3> 
<ul>
<li> INT 16h is used for keyboard interrupts.
<li> Read up about the keyboard buffer in text book.
</ul>

<p>
<hr>
<h3><font color=AA00AA>
KEYBOARD INTERRUPT FUNCTIONS  
</font></h3> 

<table border=3 bgcolor=#ffdaff>
<a name=msetable>
<caption>SUMMARY OF INT 16h FUNCTIONS</caption>
</a>
<tr bgcolor=99ff99>
	<th>Function Number (in reg AH)</th>
	<th>Actions</th>
</tr>
<tr>
	<td> fcn=00h: wait for keypress and read char </td>
	<td> OUTPUT: AH=scan code, AL=ascii character or 0 in non-ascii.
	<br> Program is halted until a key with scancode is pressed.
	</td>
</tr>
<tr>
	<td> fcn=01h: get keyboard status </td>
	<td> OUTPUT: 
		<ul>
		<li> ZF=0 if a key is pressed, even CTRL-BREAK
		<li> AX=0 if no scan code available
		<li> AH:AL=scan code:ascii char (as in fcn=00)
		</ul>
		NOTE: data is not removed from buffer.
		CTRL-BREAK places a zero word in the keyboard buffer
		and registers a keypress.
	</td>
<tr>
	<td>
	 fcn=02h: read keyboard flags
	</td>
	<td>
	 OUTPUT: AL=BIOS keyboard flags (in BIOS area 40:17)
		<ul>
		<li> AL[7]=insert is active
		<li> AL[6]=caps-lock is active
		<li> AL[5]=num-lock is active
		<li> AL[4]=scroll-lock is active
		<li> AL[3]=ALT key is pressed
		<li> AL[2]=CTRL key is pressed
		<li> AL[1]=left shift key is pressed
		<li> AL[0]=right shift key is pressed
		</ul>
	</td>
</tr>
<tr>
	<td>
	fcn=03h: set keyboard typematic rate
	</td>
	<td>
	INPUT: AL=set rate, BH=repeat delay, BL=typematic rate.
	<br>
	OUTPUT: none.
	<br>
	See helppc for details.
	</td>
</tr>
<tr>
	<td>
	fcn=05: keyboard buffer write
	</td>
	<td>
	Available on AT, PS/2 with extended keyboard support.
	</td>
</tr>
<!--
<tr>
	<td>
	</td>
	<td>
	</td>
</tr>
<tr>
	<td>
	</td>
	<td>
	</td>
</tr>
</tr>
-->		
</table>


<p>
<hr>
<a name=bot>
<a href=#top>
GO TO THE TOP
</a>
</a>
</body>
</html>
@
