on-internet
← Community

Why do I have to load 0xA000 into the ES register in order to write to video memory?

Stack Overflow ·

I'm using NASM to learn x86 assembly, running my code in qemu on linux. I am trying to draw a pixel on the screen. Why is it that mov bx,0xA000 mov byte [bx],0x0A doesn't seem to do anything, but mov bx,0xA000 mov es,bx mov byte [es:di],0x0A is able to draw a pixel? A second question: Why do I have to use [es:di] rather than just [es]?

Comments

Sign in or sign up to comment and upvote.

No comments yet.