Lesson 18 - the IDT

This commit is contained in:
Carlos Fenollosa
2015-02-02 12:32:46 +01:00
parent a833ee8f9e
commit 69a7c1c2a6
23 changed files with 1150 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
[bits 32] ; using 32-bit protected mode
; this is how constants are defined
VIDEO_MEMORY equ 0xb8000
WHITE_OB_BLACK equ 0x0f ; the color byte for each character
print_string_pm:
pusha
mov edx, VIDEO_MEMORY
print_string_pm_loop:
mov al, [ebx] ; [ebx] is the address of our character
mov ah, WHITE_OB_BLACK
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