Ummm...it is supposed to be like that?
Posted: Wed Mar 02, 2011 11:50 pm
I recently found a script online that writes to video memory.
While most of the stuff is a little confusing since I've just started learning NASM, what I don't get is when I launch a binary COM file of this data I'll get a blue screen with weird blotchy discolored rectangular patches all over the screen. How can I fix this?
As a side note, what are the possible results of messing with video memory/video drive?
Code: Select all
mov ax,013h ;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,0102h ;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
mov ah,4ch ;go back
int 21h ; to DOS
As a side note, what are the possible results of messing with video memory/video drive?