finish day 1

This commit is contained in:
2024-01-16 23:34:00 +08:00
parent 845aa1c6b6
commit dda87f83cd
5 changed files with 47 additions and 0 deletions

25
day_01/helloos.asm Normal file
View File

@@ -0,0 +1,25 @@
; 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