mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2024-10-27 20:34:19 +00:00
24 lines
430 B
NASM
24 lines
430 B
NASM
print:
|
|
pusha
|
|
|
|
; keep this in mind:
|
|
; while (string[i] != 0) { print string[i]; i++ }
|
|
|
|
; the comparison for string end (null byte)
|
|
start:
|
|
mov al, [bx] ; 'bx' is the base address for the string
|
|
cmp al, 0
|
|
je done
|
|
|
|
; the part where we print with the BIOS help
|
|
mov ah, 0x0e
|
|
int 0x10 ; 'al' already contains the char
|
|
|
|
; increment pointer and do next loop
|
|
add bx, 1
|
|
jmp start
|
|
|
|
done:
|
|
popa
|
|
ret
|