aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/common.protmode.print.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/common.protmode.print.asm')
-rw-r--r--src/common/common.protmode.print.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/common/common.protmode.print.asm b/src/common/common.protmode.print.asm
new file mode 100644
index 0000000..5995e69
--- /dev/null
+++ b/src/common/common.protmode.print.asm
@@ -0,0 +1,35 @@
+;; common.protmode.print.asm
+
+%include "common.asm"
+
+_print_string_pm_vga:
+ pusha
+ mov edi, VGA_BUFFER
+ mov ah, WB_COLOR
+ xor ecx, ecx
+ xor edx, edx
+
+.print_loop:
+ lodsb
+ test al, al
+ jz .done
+
+ push eax
+ mov eax, edx
+ imul eax, eax, 160
+ lea edi, [VGA_BUFFER + eax]
+ lea edi, [edi + ecx * 2]
+ pop eax
+
+;; Advance cursor
+ inc cl
+ cmp cl, 80
+ jb .print_loop
+ xor cl, cl
+ inc dl
+
+ jmp .print_loop
+
+.done:
+ popa
+ ret