Answer the question
In order to leave comments, you need to log in
Why is this asm code running?
I have code that compiles with NASM and runs in QEMU. It should just output Hello, world in the BIOS. But along with it, reboot_req is launched. What is the problem?
[org 0x8000]
mov si, helloworld
call print
mov si, newline
call print
reboot_req:
mov si, reboot_request
call print
mov ah, 0x0
int 0x16
int 0x19
%include "print.asm"
helloworld: db "Hello, world!!!", 0
newline: db 0x0d, 0xa, 0
reboot_request: db 0x0d,0xa, "Press any key to reboot...", 0x0d,0xa,0
cmd: db "$ ", 0
wrongcmd: db "Wrong command!!!", 0
times 2048-($-$$) db 0
print:
push ax
push si
mov ah, 0x0e
.Loop:
mov al, [si]
cmp al, 0
je .Exit
int 0x10
inc si
jmp .Loop
.Exit:
pop ax
pop si
ret
Answer the question
In order to leave comments, you need to log in
print.asm
print:
push ax
push si
......
pop ax
pop si
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question