From 4060b45e58139291e852dd7c34a3b56aff079e38 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 12 Jan 2021 16:17:14 +0100 Subject: [PATCH] Bugs --- compile.sh | 2 +- src/bootloader.asm | 20 +++++++++++++------- src/elib/io.asm | 2 ++ src/equ/ASCII.asm | 9 +++++++++ src/{BIOS_equ.asm => equ/BIOS.asm} | 0 5 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/elib/io.asm create mode 100644 src/equ/ASCII.asm rename src/{BIOS_equ.asm => equ/BIOS.asm} (100%) diff --git a/compile.sh b/compile.sh index eaa433d..b009096 100755 --- a/compile.sh +++ b/compile.sh @@ -3,4 +3,4 @@ srcDir=src binDir=bin -nasm -f bin $srcDir/bootloader.asm -o $binDir/bootloader.bin +nasm -f bin $srcDir/bootloader.asm -i $srcDir -o $binDir/bootloader.bin diff --git a/src/bootloader.asm b/src/bootloader.asm index 43e5c8a..2ce8ab4 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -1,4 +1,6 @@ -%include "BIOS_equ.asm" +%include "equ/BIOS.asm" +%include "equ/ASCII.asm" + mov ah, 0x0e ; enter teletype mode (BIOS) mov al, "e" @@ -16,17 +18,21 @@ int BIOS_INT ; ALPHABET PRINT mov al, 64 ; one less than A since we are printing in a loop and it increments before sys interupt loop: + ; Print the alphabetic char inc al ; move to next char int BIOS_INT ; bios interupt to print it - push al ; push al onto stack + + ;push al ; push al onto stack - mov al, 10 ; ASCII linebreak - int BIOS_INT + ; Print a linebreak + ;mov al, ASCII_LINEBREAK + ;int BIOS_INT - pop al ; return to char + ; Prepair for next iteration + ;pop al ; return to char - cmp al, 91 ; 26 letters in english alphabet (65 + 26) - jl loop ; if al < 65+26: jmp loop + cmp al, 90 ; 26 letters in english alphabet (64 + 26) + jl loop ; if al < 64+26: jmp loop jmp $ diff --git a/src/elib/io.asm b/src/elib/io.asm new file mode 100644 index 0000000..49b94f2 --- /dev/null +++ b/src/elib/io.asm @@ -0,0 +1,2 @@ +; eLibrary +; Input/Output sr diff --git a/src/equ/ASCII.asm b/src/equ/ASCII.asm new file mode 100644 index 0000000..e9f1cc9 --- /dev/null +++ b/src/equ/ASCII.asm @@ -0,0 +1,9 @@ +; ASCII EQUs +ASCII_END equ 0 +ASCII_BELL equ 7 +ASCII_BACKSPACE equ 8 +ASCII_HORIZONTAL_TAB equ 9 +ASCII_VERTICAL_TAB equ 11 +ASCII_LINEBREAK equ 10 +ASCII_CARRIAGE_RETURN equ 13 +ASCII_CLEAR equ 12 diff --git a/src/BIOS_equ.asm b/src/equ/BIOS.asm similarity index 100% rename from src/BIOS_equ.asm rename to src/equ/BIOS.asm