summaryrefslogtreecommitdiff
path: root/boot/print16.asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-08-27 03:20:16 +0200
committerMichal Idziorek <m.i@gmx.at>2014-08-27 03:20:16 +0200
commit50c7bdbe826b5b425748a11273d14e3aed2ce851 (patch)
tree8fc2bec5576aad366b6f9f3f1fcc406f6a3eeb33 /boot/print16.asm
parentfc7022286a14e7325907fb4e77aa44330037229b (diff)
many changes and adaptions and VESA mode !!
Diffstat (limited to 'boot/print16.asm')
-rw-r--r--boot/print16.asm28
1 files changed, 28 insertions, 0 deletions
diff --git a/boot/print16.asm b/boot/print16.asm
new file mode 100644
index 0000000..5d8ad5c
--- /dev/null
+++ b/boot/print16.asm
@@ -0,0 +1,28 @@
+[bits 16]
+
+;print_string routine ([bx])
+;this routine will print a null terminated string at [bx] to the screen.
+print_string:
+
+ pusha ;push all registers
+ mov ah,0x0e
+
+ print_string_loop:
+
+ ;check if value at [bx] is "\0" (end of string)
+ mov cl,[bx]
+ cmp cl,0
+ je print_string_finish
+
+ ;otherwise instruct BIOS to print the current char
+ mov al,cl
+ int 0x10
+
+ ;proceed with next char
+ inc bx
+ jmp print_string_loop
+
+ print_string_finish:
+
+ popa ;pop all registers
+ ret ;return to caller