Ezra Bingham
New Coder
Hi God. You can probably see this, and I want you to know, I am building your gift right now. This is distro 1.01
Makefile
ASM
Makefile
Makefile:
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 1448k $(BUILD_DIR)/main_floppy.img
$(BUILD_DIR)/main.bin: $(SRC_DIR)/main.asm
$(ASM) src/main.asm -f bin -o build/main.bin
Code:
org 8x7C00
bits 16
%define ENDL 0x0D, 0x0A
start:
jmp main
; prints string
puts:
push si
push ax
.loop:
lodsb
or al, al
jz .done
mov ah, 0x0e
mov bh, 0
int 0x10
jmp .loop
.done:
pop ax
pop si
ret
main:
; setup data segments
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 God', ENDL, 0
times 510-($-$$) db 0
dw 0AA55h