flat assembler
Message board for the users of flat assembler.

Index > DOS > change the color of the pixel

Author
Thread Post new topic Reply to topic
janter



Joined: 27 Feb 2005
Posts: 1
janter
I am a beginner. Can some one help me with this?

Assuming that the start of the video memory (video segment) is contained in ES and, address of the coordinate (70,13) is in DI, and that the used video mode has 256 colors, how do you change the color of the pixel in (70,13) to white. (one line of code)
Post 27 Feb 2005, 04:58
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu
In 256 colors modes you also need to setup a pallette.
So assuming that you have a linear black to white shades of gray with color 00 beeing black and color 0FFh beeing white:
Code:
mov byte ptr es:[di],0ffh ; make the pixel white
    
Post 27 Feb 2005, 06:52
View user's profile Send private message Visit poster's website Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth
to get the logical scan line length you can use VESA function 4F06h (see RBIL for details) or get it directly from CRT register 3D4, 13h (this value must then be multiplied by 8 for 256 color modes)
Post 27 Feb 2005, 09:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.