30_day_os/day_01/helloos.asm
2024-01-16 23:34:00 +08:00

26 lines
511 B
NASM

; Hello World Program in 16-bit Assembly
; This code is intended to run on a DOS system.
.model small
.stack 100h
.data
helloMessage db 'Hello, World!$'
.code
start:
; Initialize the data segment
mov ax, @data
mov ds, ax
; Display the message
mov ah, 09h ; AH = 09h for displaying a string in DOS
lea dx, helloMessage ; Load the address of the message into DX
int 21h ; Call DOS interrupt
; Terminate the program
mov ax, 4C00h ; Terminate program
int 21h
end start