[bits 32]

; defining constants
VIDEO_MEMORY equ 0xb8000
WHITE_ON_BLACK equ 0x0f ; color byte

print_string_pm:
    pusha
    mov edx, VIDEO_MEMORY

print_string_pm_loop:
    mov al, [ebx] ; [ebx] is address of char
    mov ah, WHITE_ON_BLACK

    cmp al, 0 ; is end of string?
    je print_string_pm_done

    mov [edx], ax ; store char + 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