video memory addressing
Posted: Tue Mar 08, 2011 10:08 pm
Okay, just a quick question. How would you go about writing to an address like a000:013f? I've tried various things like a000:[013f] but none seem to work?
The Place to Start for Operating System Developers
https://f.osdev.org/
That's a real mode address. I.e., the 0xa000 must be loaded to a segment register, and the actual access be offset by the 0x013f.wannabedeveloper wrote:How would you go about writing to an address like a000:013f?
Code: Select all
Mov BX, a000h
Mov ES, BX
Mov BX, 013fh
Mov AL, [ES:BX]
Code: Select all
push 0a000h
pop es
mov byte ptr es:[13fh],whatever
It's not 'sector register' but a 'segment register'. Anyway, well done Solar.Solar wrote:That's a real mode address. I.e., the 0xa000 must be loaded to a sector register, and the actual access be offset by the 0x013f.wannabedeveloper wrote:How would you go about writing to an address like a000:013f?
Of course, things are different in protected mode.Code: Select all
Mov BX, a000h Mov ES, BX Mov BX, 013fh Mov AL, [ES:BX]