I'm using NASM on Windows. I have the following simple assembly code in NASM-syntax:
section .data
cha db 'A'
section .text
global _start
_start:
mov ah, 0xa
mov al, [cha]
mov cx, 1h
int 10h
times 510-($-$$) db 0
dw 0xaa55
I generate my bootloader with this command:
nasm bootloader.asm -f bin -o bootloader.bin
I use the ROM-BIOS built-in interrupt to print a character in the screen. The problem is that when I execute the program, it doesn't print "A" but "S". I tried defining different letters like "H" but "S" was being displayed. What am I doing wrong?
Note: The two ending lines of the code are just because I run the program in QEMU. In other words they are meaningless for the execution of the code but meaningful for the QEMU to run it!