shadeos/learning/old_src/print.asm

33 lines
541 B
NASM

print:
pusha
; logic being implemented here:
; while ( string[i] != 0 ) { print string[i]; i++ }
start:
mov al, [bx]
cmp al, 0 ; check if al (byte we are printing) is a 0 (null byte)
je done ; if so, jump to done
; print with BIOS help
mov ah, 0x0e
int 0x10 ; char already in al
add bx, 1 ; increment pointer
jmp start ; repeat
done:
popa
ret
print_nl:
pusha
mov ah, 0x0e
mov al, 0x0a ; newline char
int 0x10
mov al, 0x0d ; carriage return
int 0x10
popa
ret