Page 1 of 1

video memory addressing

Posted: Tue Mar 08, 2011 10:08 pm
by wannabedeveloper
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?

Re: video memory addressing

Posted: Tue Mar 08, 2011 11:10 pm
by JackScott
Firstly, what language are you trying to use?
Secondly, can you show us the code that isn't working?
Thirdly, what about it isn't working?

Re: video memory addressing

Posted: Wed Mar 09, 2011 6:40 am
by a5498828
question is how would i write? wtf. i would use for eg. mov/movs/stos, or a bios function.

this is address of a graphic mode of video controller. Have you set it go graphic mode? Maybe you dont see pixel. TRy reading it back.

Have you set cache to uc/wc/wt? if its wb it wont work well, and wp you wont read correct data but pixel wil lstill display correctly.

Re: video memory addressing

Posted: Wed Mar 09, 2011 7:31 am
by Solar
wannabedeveloper wrote:How would you go about writing to an address like a000:013f?
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.

Code: Select all

Mov BX, a000h
Mov ES, BX
Mov BX, 013fh
Mov AL, [ES:BX] 
Of course, things are different in protected mode.

Re: video memory addressing

Posted: Thu Mar 10, 2011 4:38 pm
by Gigasoft

Code: Select all

push 0a000h
pop es
mov byte ptr es:[13fh],whatever

Re: video memory addressing

Posted: Thu Mar 10, 2011 7:10 pm
by Chandra
Solar wrote:
wannabedeveloper wrote:How would you go about writing to an address like a000:013f?
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.

Code: Select all

Mov BX, a000h
Mov ES, BX
Mov BX, 013fh
Mov AL, [ES:BX] 
Of course, things are different in protected mode.
It's not 'sector register' but a 'segment register'. Anyway, well done Solar.