2021-06-22 13:05:09 +00:00
|
|
|
;Print a string ending in a null from SI.
|
|
|
|
printstr:
|
|
|
|
|
2021-07-10 17:49:06 +00:00
|
|
|
;Store AX and SI in the stack
|
2021-06-22 13:05:09 +00:00
|
|
|
push ax
|
|
|
|
push si
|
|
|
|
|
|
|
|
;Print the string
|
|
|
|
;Load the current character
|
2021-07-10 17:49:06 +00:00
|
|
|
.loop:
|
2021-06-22 13:05:09 +00:00
|
|
|
lodsb
|
|
|
|
;Check for the string end
|
|
|
|
cmp al, 0x0
|
|
|
|
je .done
|
|
|
|
;Print the character
|
|
|
|
mov ah, 0xe
|
|
|
|
int 0x10
|
2021-07-10 17:49:06 +00:00
|
|
|
;Print the next character
|
2021-06-22 13:05:09 +00:00
|
|
|
jmp .loop
|
|
|
|
|
|
|
|
;Load the initial registers from the stack
|
2021-07-10 17:49:06 +00:00
|
|
|
.done:
|
2021-06-22 13:05:09 +00:00
|
|
|
pop si
|
|
|
|
pop ax
|
|
|
|
|
2021-07-10 17:49:06 +00:00
|
|
|
;Return
|
2021-06-22 13:05:09 +00:00
|
|
|
iret
|