Created
June 9, 2019 15:45
-
-
Save KowalczykBartek/0ebcc6e96c360dd6130c0f9c69c535af to your computer and use it in GitHub Desktop.
exercise from 3.4.8 http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[org 0x7c00] | |
mov bx, HELLO_MSG | |
call print_string | |
mov bx, GOODBYE_MSG | |
call print_string | |
jmp $ | |
; arg0: bx - pointer to string to be printed | |
print_string: | |
pusha | |
iteration: | |
mov cx, [bx] | |
cmp cl, 0 | |
je end | |
; print character | |
mov al, cl | |
mov ah, 0x0e | |
int 0x10 | |
; increment string pointer | |
add bx, 1 | |
jmp iteration | |
end: | |
popa | |
ret | |
HELLO_MSG: | |
db 'Hello, World !', 0 | |
GOODBYE_MSG: | |
db 'Goodby!', 0 | |
times 510-($-$$) db 0 | |
dw 0xaa55 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment