flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Boot screen using 4-bit raw data/plotting individual pixels


How many minutes do you spend on the computer each day?
<=10
0%
 0%  [ 0 ]
10-20
0%
 0%  [ 0 ]
20-50
0%
 0%  [ 0 ]
50-75
0%
 0%  [ 0 ]
75-100
0%
 0%  [ 0 ]
100-200
7%
 7%  [ 1 ]
200-500
35%
 35%  [ 5 ]
500-750
14%
 14%  [ 2 ]
750-1000
14%
 14%  [ 2 ]
=>1000
28%
 28%  [ 4 ]
Total Votes : 14

Author
Thread Post new topic Reply to topic
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla
I am writing an 16-bit x86 operating system and I need something that can display raw pixel data (640x480, 16-colors) from an array of bytes (pref. from a set variable, eg PIXELS DB 0x2F,0x33,0x95,0x98,...). I could not find code on the Internet that was compatible with FASM (and the ones that were required DOS). How can you display pixels one by one on the screen, set to a resolution of 640x480 without using DOS?


Last edited by Adam Kachwalla on 01 Apr 2006, 23:48; edited 1 time in total
Post 01 Apr 2006, 11:07
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
For that you use
Code:
                mov ax,012h    ;VGA mode                int 10h        ;640 x 480 16 colors.                mov ax,0A000h                mov es,ax      ;ES points to the video memory.                mov dx,03C4h   ;dx = indexregister                mov ax,0F02h   ;INDEX = MASK MAP,                 out dx,ax      ;write all the bitplanes.                mov di,0       ;DI pointer in the video memory.                mov cx,38400   ;(640 * 480)/8 = 38400                mov ax,0FFh    ;write to every pixel.                rep stosb      ;fill the screen                jmp $     
But you will have many other problems, so you would be much better off, using vesa.
Heres a none vesa one, for320*200*256 pcx picture: http://board.flatassembler.net/topic.php?t=2694
Post 01 Apr 2006, 14:55
View user's profile Send private message Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla
Where did you get the formula (640*480)/8 from (the /8 bit)?
Also, if I need to write the raw pixel data to video memory, is this code alright?

Code:
PIXELS DB 0x2F,0x33,0x95,0x98,...
MOV EX,PIXELS    


Also, what are the possible colors and patterns (the numbers)
Post 01 Apr 2006, 23:44
View user's profile Send private message 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 YouTube, Twitter.

Website powered by rwasa.