-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathkeyboard_wait_input.asm
More file actions
38 lines (33 loc) · 1.76 KB
/
keyboard_wait_input.asm
File metadata and controls
38 lines (33 loc) · 1.76 KB
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
; =============================================================================
; TITLE: Keyboard Wait (Input Interception)
; DESCRIPTION: Demonstrates how to pause program execution by waiting for a
; BIOS keyboard event (INT 16H / AH=00H).
; AUTHOR: Amey Thakur (https://github.com/Amey-Thakur)
; REPOSITORY: https://github.com/Amey-Thakur/8086-ASSEMBLY-LANGUAGE-PROGRAMS
; LICENSE: MIT License
; =============================================================================
ORG 100H ; COM file entry point
; -----------------------------------------------------------------------------
; MAIN CODE SECTION
; -----------------------------------------------------------------------------
MAIN PROC NEAR
; -------------------------------------------------------------------------
; WAIT FOR KEYPRESS (BIOS INT 16H, AH=00H)
; This is a blocking call. The program will not proceed until a key is hit.
; Returns: AH = Scan code, AL = ASCII char
; -------------------------------------------------------------------------
MOV AH, 00H ; BIOS: Get keystroke function
INT 16H ; Call keyboard BIOS
; Graceful Exit to DOS
MOV AX, 4C00H ; AH=4Ch, AL=00h
INT 21H
MAIN ENDP
END MAIN
; =============================================================================
; TECHNICAL NOTES
; =============================================================================
; 1. SYSTEM PAUSE:
; - Use this to prevent console windows from closing immediately.
; - Unlike DOS input functions, this BIOS call does not echo the character.
; - Useful for "Press any key to continue..." logic.
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =