Download presentation
Presentation is loading. Please wait.
Published byGerard Blake Modified over 9 years ago
1
1 Advanced Features of Keyboard Processing Suthida Chaichomchuen std@kmitnb.ac.th
2
2 Introduction Shift status byte Scan code Keyboard buffer area
3
3 INT 21H FUNCTIONS 01H : Keyboard input with echo 06H : Direct console I/O 07H : Direct keyboard input without echo 08H : Keyboard input without echo 0AH : Buffered keyboard input 0BH : Check keyboard status 0CH : Clear buffer & invoke function
4
4 INT 16H FUNCTIONS 00H : Read a character 01H : Determine if character present 02H : Return current shift status 05H : Keyboard write 10H : Read keyboard character 11H : Determine if character present 12H : Return current shift status
5
5 Basic key types Standard characters –A-Z, 0-9, Characters: % $ # Extended function keys –Program function keys:, + –Numeric keypad keys with NumLock toggled off:,, – +alphabetics, +program-function keys Control keys –,,
6
6 Keyboard shift status Segment of data area is 40[0]H First byte of current keyboard shift status at 40:17H Bits set to 1 indicate following –7 : Insert active –6 : CapsLock state active –5 : NumLock state active –4 : ScrollLock state active –3 : pressed –2 : pressed –1 : pressed –0 : pressed
7
7 Keyboard shift status Second byte for the enhanced keyboard at 40:18H Bits set to 1 indicate following –7 : Insert pressed –6 : CapsLock pressed –5 : NumLock pressed –4 : ScrollLock pressed –3 : Ctrl/NumLock (pause) active –2 : SysReq pressed –1 : Left Alt pressed –0 : Left Ctrl pressed
8
8 INT 21H Function 01H Keyboard input with echo Response to a + request AH = 01H Value return –AL <> 0 : ASCII character –AL = 0 : user has pressed an extended function key Example –MOVAH,01H –INT21H
9
9 INT 21H Function 06H Direct console I/O Input : load 0FFH into DL Output : load ASCII character into DL AH = 06H Example –MOVAH,06H –INT21H
10
10 INT 21H Function 07H Direct keyboard input without echo Not response to a + request AH = 07H Example –MOVAH,07H –INT21H
11
11 INT 21H Function 08H Keyboard input without echo Work like function 01H AH = 08H Example –MOVAH,08H –INT21H
12
12 INT 21H Function 0AH Buffered keyboard input Inability to accept extended function keys AH = 0AH Example –MOVAH,0AH –LEADX,msg –INT21H
13
13 INT 21H Function 0BH Check keyboard status AH = 0BH Return value to AL –AL = FFH : character is available –AL = 00H : no character is available Example –MOVAH,0BH –INT21H
14
14 INT 21H Function 0CH Clear keyboard buffer and invoke function AH = 0CH AL = required function Example –MOVAH,0CH –MOVAL,function –MOVDX,kbarea –INT21H
15
15 INT 16H Function 00H Read a character AH = 00H Example –MOVAH,00H –INT16H
16
16 INT 16H Function 01H Determine whether a character is present AH = 01H Example –MOVAH,01H –INT16H
17
17 INT 16H Function 02H Return the current status AH = 02H AL = value return Example –MOVAH,02H –INT16H
18
18 INT 16H Function 05H Keyboard write Insert characters in the keyboard buffer AH = 05H CH = load ASCII character CL = load scan code Example –MOVAH,05H –INT16H
19
19 INT 16H Function 10H Read a keyboard character AH = 10H Example –MOVAH,10H –INT16H
20
20 INT 16H Function 10H Key pressed –Regular ASCII character AL = ASCII character AH = scan code –Extended function key AL = 00H AH = scan code –Extended duplicate control key AL = E0H AH = scan code
21
21 INT 16H Function 11H Determine whether a character is present Same as function 01H –accept the extended functions AH = 11H Example –MOVAH,11H –INT16H
22
22 INT 16H Function 12H Return the current keyboard shift status Similar to function 02H AH = 12H Example –MOVAH,12H –INT16H
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.