From 72ea40c23e799ad1238fd5d2a3189534a5dfa7da Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 21 May 2021 10:28:51 +0200 Subject: [PATCH] Added VGA print SR --- src/equ/VGA.asm | 4 ++++ src/equ/vga.asm | 0 src/vga/print.asm | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 src/equ/VGA.asm create mode 100644 src/equ/vga.asm create mode 100644 src/vga/print.asm diff --git a/src/equ/VGA.asm b/src/equ/VGA.asm new file mode 100644 index 0000000..a3f90d7 --- /dev/null +++ b/src/equ/VGA.asm @@ -0,0 +1,4 @@ +; VGA EQUs + +VIDEO_MEM equ 0xb8000 + diff --git a/src/equ/vga.asm b/src/equ/vga.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/vga/print.asm b/src/vga/print.asm new file mode 100644 index 0000000..4b8aac6 --- /dev/null +++ b/src/vga/print.asm @@ -0,0 +1,25 @@ +[bits 32] + +; VGA base address: 0xb8000 +; Charpos = 0xb8000 + 2 * (row * 80 + col) + +vga_print: + pusha + mov edx, VIDEO_MEM + + vga_print_loop: + mov al, [ebx] + mov ah, 0x0f + + cmp al, ASCII_END + je vga_print_return + + mov [edx], ax + inc ebx + add edx, 2 + + jmp vga_print_loop + + vga_print_return: + popa + ret