Help-Clear VGA screen in assembler 
Author Message
 Help-Clear VGA screen in assembler

Hi

Does anyone knows how to fast clear 640*480 graphics
sceen in assembler ?

Thanks
Tomran



Mon, 08 Mar 2004 01:20:12 GMT  
 Help-Clear VGA screen in assembler
Quote:
>Does anyone knows how to fast clear 640*480 graphics
>sceen in assembler ?

If you can't use the accelerator:

xor eax,eax
mov ecx,640*480*bpp/32
les di,vga_buffer
rep stos dword ptr es:di

H



Mon, 08 Mar 2004 04:59:04 GMT  
 Help-Clear VGA screen in assembler
mov ch, 01h ; set window size to max
mov cl, 01h
mov dh, 0FFh
mov dl, 0FFh
mov al, 0 ; lines to clear (0 clears entire window)
mov bh, 20h ; character to fill with (space)
mov ah, 06h ; scroll up window
int 10h ; video interrupt

--Ravon

Quote:

> Hi

> Does anyone knows how to fast clear 640*480 graphics
> sceen in assembler ?

> Thanks
> Tomran



Mon, 08 Mar 2004 08:56:02 GMT  
 Help-Clear VGA screen in assembler

says...

Quote:
> >Does anyone knows how to fast clear 640*480 graphics
> >sceen in assembler ?
> If you can't use the accelerator:

> xor eax,eax
> mov ecx,640*480*bpp/32
> les di,vga_buffer
> rep stos dword ptr es:di

At least for something like mode 12h, that won't normally do the job
by itself.  The problem is that the memory is viewed as four separate
planes, only one of which is visible in the address space at a time.  

It's been quite a while since I did much directly with VGA hardware,
but IIRC, to clear the screen as quickly as possible, you normally
want to enable Set/Reset mode for all four planes, write zeros into
the Set/Reset register, and then write values to the display memory
much as shown above.

In this case, the values you attempt to write to the display memory
mean nothing -- your writing is only generating addresses, and the
values written into those locations are copied from the set/reset
register.

The good point of this method is that you can clear the bits in all
four planes at the same time, rather than having to write zeros four
times, once to each of the four planes.

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.



Mon, 08 Mar 2004 11:56:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. GUIDA ASSEMBLER VGA - VGA ASSEMBLER GUIDE

2. Help: Can I clear the Screen

3. Need Help : clearing the screen

4. "Clear screen / goto (x,y).. please help

5. Mono VGA screens - Ahhh

6. VGA Screen Border

7. mem to vga screen

8. VGA Character Print Screen Utility

9. Fortran Libraries for saving/restoring SVGA/VGA screen in protected mode

10. ASSEMBLER VGA ROUTINES?

11. clear screen

12. Clearing Screens

 

 
Powered by phpBB® Forum Software