Uploading this stupid project
This commit is contained in:
commit
a476d8b792
11
Makefile
Normal file
11
Makefile
Normal 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
BIN
build/main.bin
Normal file
Binary file not shown.
BIN
build/main_floppy.img
Normal file
BIN
build/main_floppy.img
Normal file
Binary file not shown.
51
src/main.asm
Normal file
51
src/main.asm
Normal 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
|
Loading…
x
Reference in New Issue
Block a user