-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathhello_world_interrupt.asm
More file actions
68 lines (51 loc) · 1.86 KB
/
hello_world_interrupt.asm
File metadata and controls
68 lines (51 loc) · 1.86 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
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
; =============================================================================
; TITLE: Hello World (Interrupt-based)
; DESCRIPTION: Demonstrate character-by-character printing using BIOS TTY
; sub-function (INT 10H / AH=0EH).
; 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
; -----------------------------------------------------------------------------
START:
; AH does not change during INT 10H / 0EH, so we set it only once
MOV AH, 0EH ; Select BIOS Teletype (TTY) function
; Print each character of "Hello World!" manually
MOV AL, 'H' ; Load ASCII char
INT 10H ; Trigger BIOS video service
MOV AL, 'e'
INT 10H
MOV AL, 'l'
INT 10H
MOV AL, 'l'
INT 10H
MOV AL, 'o'
INT 10H
MOV AL, ' '
INT 10H
MOV AL, 'W'
INT 10H
MOV AL, 'o'
INT 10H
MOV AL, 'r'
INT 10H
MOV AL, 'l'
INT 10H
MOV AL, 'd'
INT 10H
MOV AL, '!'
INT 10H
; Back to OS
RET
END
; =============================================================================
; TECHNICAL NOTES
; =============================================================================
; 1. INTERRUPT NOTES:
; - INT 10h AH=0Eh is a BIOS level service, making it more low-level than DOS.
; - It handles cursor advancement and screen wrapping automatically.
; - Efficient for single character logic without complex buffer overhead.
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =