Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

BinaryOS

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
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
ASM
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
 
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
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
ASM
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
Hi there,

Do you have a github account you could link to instead?
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom