Interruption 16h |
Fonction 00h |
Lecture d'un caractère en provenance du clavier |
|---|---|---|
| PC, XT, AT, PS/2 | ||
Description
Cette fonction permet la lecture d'un caractère au clavier et de connaître également le code de la touche (appelé «Scan Code» en anglais).
Entrée
| Registre | Description |
|---|---|
| AH | 00h |
Sortie
| Registre | Description | |
|---|---|---|
| AL | Ce registre permet d'indiquer le code ASCII de la touche du clavier | |
| AH | Ce registre permet d'indiquer le code de balayage de la touche du clavier (Scan Code) | |
| AX | Ce registre, étant la combinaison des registres AL et AH, permet d'indiquer le code de ASCII et de balayage de la touche du clavier, et les valeurs les plus communes sont celles-ci : | |
| Code | Touche | |
| 0000h | Break | |
| 011Bh | Esc | |
| 0200h | Alt+Space | |
| 0300h | Ctrl+3 | |
| 0400h | Ctrl+Insert | |
| 0400h | Shift+Insert | |
| 0500h | Ctrl+Delete | |
| 0600h | Shift+Delete | |
| 0700h | Shift+Delete | |
| 071Eh | Ctrl+6 | |
| 0E00h | Alt+Backspace | |
| 0E08h | BackSpace | |
| 0E7Fh | Ctrl+BackSpace | |
| 0F00h | Shift+Tab | |
| 0F09h | Tab | |
| 1000h | Alt+Q | |
| 1011h | Ctrl+Q | |
| 1100h | Alt+W | |
| 1117h | Ctrl+W | |
| 1200h | Alt+E | |
| 1205h | Ctrl+E | |
| 1300h | Alt+R | |
| 1312h | Ctrl+R | |
| 1400h | Alt+T | |
| 1414h | Ctrl+T | |
| 1500h | Alt+Y | |
| 1519h | Ctrl+Y | |
| 1600h | Alt+U | |
| 1615h | Ctrl+U | |
| 1700h | Alt+I | |
| 1709h | Ctrl+I | |
| 1800h | Alt+O | |
| 180Fh | Ctrl+O | |
| 1900h | Alt+P | |
| 1910h | Ctrl+P | |
| 1C0Ah | Ctrl+Enter | |
| 1C0Dh | Enter | |
| 1E00h | Alt+A | |
| 1E01h | Ctrl+A | |
| 1F00h | Alt+S | |
| 1F13h | Ctrl+S | |
| 2000h | Alt+D | |
| 2004h | Ctrl+D | |
| 2100h | Alt+F | |
| 2106h | Ctrl+F | |
| 2200h | Alt+G | |
| 2207h | Ctrl+G | |
| 2300h | Alt+H | |
| 2308h | Ctrl+H | |
| 2400h | Alt+J | |
| 240Ah | Ctrl+J | |
| 2500h | Alt+K | |
| 250Bh | Ctrl+K | |
| 2600h | Alt+L | |
| 260Ch | Ctrl+L | |
| 2C00h | Alt+Z | |
| 2C1Ah | Ctrl+Z | |
| 2D00h | Alt+X | |
| 2D18h | Ctrl+X | |
| 2E00h | Alt+C | |
| 2E03h | Ctrl+C | |
| 2F00h | Alt+V | |
| 2F16h | Ctrl+V | |
| 3000h | Alt+B | |
| 3002h | Ctrl+B | |
| 3100h | Alt+N | |
| 310Eh | Ctrl+N | |
| 3200h | Alt+M | |
| 320Dh | Ctrl+M | |
| 3B00h | F1 | |
| 3C00h | F2 | |
| 3D00h | F3 | |
| 3E00h | F4 | |
| 3F00h | F5 | |
| 4000h | F6 | |
| 4100h | F7 | |
| 4200h | F8 | |
| 4300h | F9 | |
| 4400h | F10 | |
| 4700h | Home | |
| 4800h | ↑ | |
| 4900h | PgUp | |
| 4A2Dh | Gris foncé - | |
| 4B00h | ← | |
| 4C00h | Pavé numérique (Keypad) 5 | |
| 4D00h | → | |
| 4E2Bh | Gris foncé + | |
| 4F00h | End | |
| 5000h | ↓ | |
| 5200h | Insert | |
| 5300h | Delete | |
| 5400h | Shift+F1 | |
| 5500h | Shift+F2 | |
| 5600h | Shift+F3 | |
| 5700h | Shift+F4 | |
| 5800h | Shift+F5 | |
| 5900h | Shift+F6 | |
| 5A00h | Shift+F7 | |
| 5B00h | Shift+F8 | |
| 5C00h | Shift+F9 | |
| 5D00h | Shift+F10 | |
| 5E00h | Ctrl+F1 | |
| 5F00h | Ctrl+F2 | |
| 6000h | Ctrl+F3 | |
| 6100h | Ctrl+F4 | |
| 6200h | Ctrl+F5 | |
| 6300h | Ctrl+F6 | |
| 6400h | Ctrl+F7 | |
| 6500h | Ctrl+F8 | |
| 6600h | Ctrl+F9 | |
| 6700h | Ctrl+F10 | |
| 6800h | Alt+F1 | |
| 6900h | Alt+F2 | |
| 6A00h | Alt+F3 | |
| 6B00h | Alt+F4 | |
| 6C00h | Alt+F5 | |
| 6D00h | Alt+F6 | |
| 6E00h | Alt+F7 | |
| 6F00h | Alt+F8 | |
| 7000h | Alt+F9 | |
| 7100h | Alt+F10 | |
| 7200h | Ctrl+PrtScrn | |
| 7300h | Ctrl+← | |
| 7400h | Ctrl+→ | |
| 7500h | Ctrl+End | |
| 7600h | Ctrl+PgDn | |
| 7700h | Ctrl+Home | |
| 7800h | Alt+1 | |
| 7900h | Alt+2 | |
| 7A00h | Alt+3 | |
| 7B00h | Alt+4 | |
| 7C00h | Alt+5 | |
| 7D00h | Alt+6 | |
| 7E00h | Alt+7 | |
| 7F00h | Alt+8 | |
| 8000h | Alt+9 | |
| 8100h | Alt+0 | |
| 8200h | Alt+Minus | |
| 8300h | Alt+= | |
| 8400h | Ctrl+PgUp | |
Remarques
- L'apparence de l'interruption 16h, Fonction 00h ressemblerait à ceci en langage évolué comme le Turbo Pascal 6 ou postérieur :
- Function ReadKey:Word;
- Var
- K:Word;
- KByte:Byte Absolute K;
- Begin
- Repeat Until Keypressed;
- ASM CLI; END;
- K := MemW[$0040:MemW[$0040:$1A]];
- Inc(MemW[$0040:$1A],SizeOf(Word));
- If(MemW[$0040:$1A]=MemW[$0040:$82])Then MemW[$0040:$1A]:=MemW[$0040:$80];
- ASM STI; END;
- If(KByte in [$D0,$E0])Then KByte := 0;
- ReadKey := K;
- End;
- L'apparence de l'interruption 16h, Fonction 00h ressemblerait à ceci en langage évolué comme le langage C de «Turbo C»:
- #include <mem.h>
- #include <dos.h>
- unsigned int ReadKey(void) {
- unsigned int K;
- do{}while(Keypressed);
- CLI;
- K=peek(0x0040,peek(0x0040,0x1A));
- poke(0x0040,0x1A,peek(0x0040,0x1A)+2);
- if(peek(0x0040,0x1A)==peek(0x0040,0x82)) poke(0x0040,0x1A,peek(0x0040,0x80));
- STI;
- if((K & 0xFF)==0xD0)||((K & 0xFF)==0xE0) K&=0xFF00;
- return K;
- }
Exemples
L'exemple suivant permet d'attendre que l'utilisateur est enfoncé la touche ESC :
Voici le même exemple pour le langage de programmation Pascal du Turbo Pascal 6 ou postérieur :
Voir également
Interruption 16h, Fonction 10h : Lit le clavier étendue
Références
Aide-mémoire des interruptions du MS-DOS, Edition Marabout, Philippe Mercier, 1990, ISBN: 2-501-01297-6, page 91.
Dernière mise à jour : Jeudi, le 3 mars 2016
