Hello, I am having a small problem that is giving me fits. I am in the very
early stages of OS development and am trying to create a small program to display an "A" to my screen by using a declared variable.
Here is what my code looks like:
[BITS 16]
LETTER DB 'A'
mov AX, 0xb800
mov ES, AX
mov BX, LETTER
mov AH, BYTE [BX]
mov BYTE [ES:0x0f9c], AH
pause:
jmp pause
ret
times 510-($-$$) db 0
dw 0xAA55
When I run this program the result is that a symbol that resembles an upside-down pi is printed to the screen. I cannot figure out what I am doing wrong. Any help is greatly appreciated.
Thank you
MWM
Newbie Needs Help
RE:Newbie Needs Help
If you are using NASM then "MOV BX, LETTER" will set BX to the address of LETTER. What you want is "MOV BX, [LETTER]", which sets BX to what's in LETTER.
Oops, try this
Sry, your MOV BX, LETTER was right, but I've noticed something else: having LETTER DB 'A' at the beginning of your code executes the 'A', which translates to an INC CX instruction. I'd move that to the bottom (below ret). Otherwise, the code runs fine on my computer.