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