My expectation is that it prints a string, but nothing is printed out. When I make the string shorter, it sometimes works, and when I make them longer again, it works sometimes.
I don't know why this isn't working.
Could somebody help me? Thanks.
The assembly code I'm using is:
(Emacs 23, Ubuntu 10.10, nasm, VirtualBox OSE)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org 0x7c00
bits 16
str:
db "Some say the world will end in fire",10,13
db "Some say in ice",10,13
db "From what I've tasted of desire",10,13
db "I hold with those who favor fire",10,13
db "But if I had to perish twice,",10,13
db "I think I know enough of hate",10,13
db "To say that for destruction ice",10,13
db "is also great and would suffice."
db "Robert Frost - Fire and Ice"
db 0
start:
xor ax,ax
mov ds,ax
mov es,ax
mov si, str
xor bx,bx
mov ah, 0x0e
print:
lodsb ;al = current char
cmp al, 0
je end
int 0x10
jmp print
end:
cli
hlt
times 510 - ($-$$) db 0
dw 0xAA55
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;