pull/1/head
E. Almqvist 4 years ago
parent 56b0ac41f0
commit 064fc9f2c7
  1. 17
      src/bootloader.asm
  2. 27
      src/elib/io.asm

@ -1,26 +1,19 @@
%include "equ/BIOS.asm"
%include "equ/ASCII.asm"
; eLIB
%include "elib/io.asm"
mov ah, BIOS_MODE_TELETYPE ; enter teletype mode (BIOS)
mov al, ASCII_LINEBREAK ; linebreak
int BIOS_INT
; Print "eOS"
mov al, "e"
int BIOS_INT
mov al, "O"
int BIOS_INT
test db "eOS", ASCII_CARRIAGE_RETURN, ASCII_LINEBREAK
mov al, "S"
int BIOS_INT
mov al, ASCII_CARRIAGE_RETURN
int BIOS_INT
; Print "eOS"
mov al, ASCII_LINEBREAK ; linebreak
int BIOS_INT
; ALPHABET PRINT TEST
mov al, 64 ; one less than A since we are printing in a loop and it increments before sys interupt

@ -1,2 +1,27 @@
; eLibrary
; Input/Output sr
; Input/Output subroutines
; String structure
; ASCII Offset = 8 bits
; Array of the char bytes, ending with 0 (ASCII_END)
eLIB_STR_OFFSET equ 8 ; 8 bits
print: ; Subroutine to print strings (from stack)
; Input: RCX, takes pointer to string from stack
pop rcx
; rcx now holds the starting point (address)
printLoop:
; Print the char
mov al, [rcx] ; dereference address to get value
cmp al, ASCII_END ; check if ASCII end
je printExit ; if reached the end then return
int BIOS_INT ; system interupt (print string)
add rcx, eLIB_STR_OFFSET ; increase with offset
jmp printLoop ; loop for next char
printExit:
ret

Loading…
Cancel
Save