2021-06-08 12:25:17 +00:00
|
|
|
;Prints a string from SI until a null.
|
2021-05-30 16:12:19 +00:00
|
|
|
|
|
|
|
printstr:
|
|
|
|
|
2021-06-06 08:18:15 +00:00
|
|
|
;Store the initial registers in the stack
|
2021-06-10 15:16:14 +00:00
|
|
|
push ax
|
2021-06-06 08:18:15 +00:00
|
|
|
|
|
|
|
.loop:
|
|
|
|
|
2021-05-30 16:12:19 +00:00
|
|
|
;Load a character
|
|
|
|
lodsb
|
|
|
|
|
|
|
|
;Check for the string end
|
|
|
|
cmp al, 0x0
|
|
|
|
je .done
|
|
|
|
|
|
|
|
;Print the character
|
|
|
|
mov ah, 0xe
|
|
|
|
int 0x10
|
|
|
|
|
|
|
|
;Repeat
|
2021-06-06 08:18:15 +00:00
|
|
|
jmp .loop
|
2021-05-30 16:12:19 +00:00
|
|
|
|
|
|
|
.done:
|
2021-06-06 08:18:15 +00:00
|
|
|
|
|
|
|
;Load the initial registers from the stack
|
2021-06-10 15:16:14 +00:00
|
|
|
pop ax
|
2021-06-06 08:18:15 +00:00
|
|
|
|
2021-05-30 16:12:19 +00:00
|
|
|
ret
|