Uploading this stupid project

This commit is contained in:
VinceAle7082 2024-07-23 14:06:32 +02:00
commit a476d8b792
4 changed files with 62 additions and 0 deletions

11
Makefile Normal file
View File

@ -0,0 +1,11 @@
ASM=nasm
SRC_DIR=src
BUILD_DIR=build
$(BUILD_DIR)/main_floppy.img: $(BUILD_DIR)/main.bin
cp $(BUILD_DIR)/main.bin $(BUILD_DIR)/main_floppy.img
truncate -s 1440k $(BUILD_DIR)/main_floppy.img
$(BUILD_DIR)/main.bin: $(SRC_DIR)/main.asm
$(ASM) $(SRC_DIR)/main.asm -f bin -o $(BUILD_DIR)/main.bin

BIN
build/main.bin Normal file

Binary file not shown.

BIN
build/main_floppy.img Normal file

Binary file not shown.

51
src/main.asm Normal file
View File

@ -0,0 +1,51 @@
org 0x7C00
bits 16
%define ENDL 0x0D, 0x0A
start:
jmp main
puts:
push si
push ax
push bx
.loop:
lodsb
or al, al
jz .done
mov ah, 0x0E
mov bh, 0
int 0x10
jmp .loop
.done:
pop bx
pop ax
pop si
ret
main:
mov ax, 0
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7C00
mov si, msg_hello
call puts
hlt
.halt:
jmp .halt
msg_hello: db 'Hello World!', ENDL, 0
times 510-($-$$) db 0
dw 0AA55h