28 lines
390 B
Plaintext
28 lines
390 B
Plaintext
;Print a string ending in a null from SI.
|
|
printstr:
|
|
|
|
;Store AX and SI in the stack
|
|
push ax
|
|
push si
|
|
|
|
;Print the string
|
|
;Load the current character
|
|
.loop:
|
|
lodsb
|
|
;Check for the string end
|
|
cmp al, 0x0
|
|
je .done
|
|
;Print the character
|
|
mov ah, 0xe
|
|
int 0x10
|
|
;Print the next character
|
|
jmp .loop
|
|
|
|
;Load the initial registers from the stack
|
|
.done:
|
|
pop si
|
|
pop ax
|
|
|
|
;Return
|
|
iret
|