2014-10-09 09:38:11 +00:00
|
|
|
[bits 32] ; using 32-bit protected mode
|
|
|
|
|
|
|
|
; this is how constants are defined
|
|
|
|
VIDEO_MEMORY equ 0xb8000
|
2015-03-23 08:27:40 +00:00
|
|
|
WHITE_ON_BLACK equ 0x0f ; the color byte for each character
|
2014-10-09 09:38:11 +00:00
|
|
|
|
|
|
|
print_string_pm:
|
|
|
|
pusha
|
|
|
|
mov edx, VIDEO_MEMORY
|
2020-07-08 09:30:00 +00:00
|
|
|
mov ah, WHITE_ON_BLACK
|
2014-10-09 09:38:11 +00:00
|
|
|
|
|
|
|
print_string_pm_loop:
|
|
|
|
mov al, [ebx] ; [ebx] is the address of our character
|
|
|
|
|
|
|
|
cmp al, 0 ; check if end of string
|
|
|
|
je print_string_pm_done
|
|
|
|
|
|
|
|
mov [edx], ax ; store character + attribute in video memory
|
|
|
|
add ebx, 1 ; next char
|
|
|
|
add edx, 2 ; next video memory position
|
|
|
|
|
|
|
|
jmp print_string_pm_loop
|
|
|
|
|
|
|
|
print_string_pm_done:
|
|
|
|
popa
|
|
|
|
ret
|