27 lines
355 B
Plaintext
27 lines
355 B
Plaintext
;Prints a string from SI until a null.
|
|
|
|
printstr:
|
|
|
|
;Store the initial registers in the stack
|
|
push ax
|
|
|
|
;Print the string
|
|
.loop:
|
|
;Load the current character
|
|
lodsb
|
|
;Check for the string end
|
|
cmp al, 0x0
|
|
je .done
|
|
;Print the character
|
|
mov ah, 0xe
|
|
int 0x10
|
|
;Repeat for the next character
|
|
jmp .loop
|
|
|
|
.done:
|
|
|
|
;Load the initial registers from the stack
|
|
pop ax
|
|
|
|
ret
|