Article View: comp.lang.asm.x86
Article #96Re: Thick
From: black_phantom
Date: Fri, 12 Mar 1999 00:00
Date: Fri, 12 Mar 1999 00:00
75 lines
3061 bytes
3061 bytes
"TK - TBD" <PISS_OFF_SPAMMERS_Thomas_Kjoernes@phoenix.com> wrote:
> tunney <bigmacmeal@hotmail.com> wrote in article
> <7c6u0d$cue$1@winter.news.rcn.net>...
> > I know that this is a thick question, but could someone explain to me
> > how to clear the screen in text and video mode, can't for the life of me
> > figure out how. Please help me I have an exam in this soon.
> > Also could someone explain int 21h service 0Ah
> >
> > Thanks a million.
>
> Clearing the screen (TEXTMODE) is easy:
>
> mov ax, 3 ; set mode 3, voil� screen is cleared.
> int 10h ;
>
> For less flickering... you could clear it by filling video mem
> directly, like this:
>
> push 0B800h
> pop es
> xor ax, ax
> xor di, di
> mov cx, 16384
> rep stosw
>
> For video mode, ask someone else.
I think it should be "graphics" mode, not "video" mode. It's not a lot harder.
For CGA graphics modes the above will also work. For chained modes (MCGA 13h)
you clear 64k starting at 0A0000h:
clear_a0000:
mov ax, 0A000h
mov es, ax
sub ax, ax
sub di, di
mov cx, 32768
cld
rep stosw
For non-chained modes the above clears only bit plane selected in sequencer.
To clear screen you need to allow write to all 4 bit planes:
mov dx, 3c4h
mov ax, 0F02h
out dx, ax
Of course, it's a good idea to save previous bit plane write bitmask and later
restore it.
Save (in BL):
mov dx, 3c4h
mov al, 2
out dx, al
inc dx
in al, dx
mov bl, al
; Here allow write to all bitplanes and clear memory.
Restore (from BL):
mov dx, 3c4h
mov al, 2
mov ah, bl
out dx, ax
That's all for standard VGA BIOS modes. I hope that you don't need to deal
with non-standard modes ('X' or how is it called now?) - it's no harder just
more dirty work.
-- Sclerosis cannot be healed but can be forgotten --
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<7cb974$13p$1@winter.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7c6u0d$cue$1@winter.news.rcn.net> <7c9dr6$as4$1@winter.news.rcn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f7d8d,be6aba38dbcf8999 X-Google-Attributes: gidf7d8d,public X-Google-Thread: feaef,be6aba38dbcf8999 X-Google-Attributes: gidfeaef,public X-Google-Thread: 10bb54,be6aba38dbcf8999 X-Google-Attributes: gid10bb54,public X-Google-Thread: 114917,be6aba38dbcf8999 X-Google-Attributes: gid114917,public From: black_phantom@my-dejanews.com Subject: Re: Thick Date: 1999/03/12 Message-ID: <7cb974$13p$1@winter.news.rcn.net> X-Deja-AN: 454211589 Approved: <johnfine@erols.com> References: <7c6u0d$cue$1@winter.news.rcn.net> <7c9dr6$as4$1@winter.news.rcn.net> X-Http-User-Agent: Mozilla/4.01 [en] (WinNT; I) X-Mozilla-Status: 0801 X-Complaints-To: abuse@rcn.com X-Trace: ODOka+rdutP33gQJ43c3Hapq/1tFnRsj1JXx0Gn085c= X-Http-Proxy: 1.0 x14.dejanews.com:80 (Squid/1.1.22) for client 192.116.192.153 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Mar 12 13:54:07 1999 GMT NNTP-Posting-Date: 12 Mar 1999 14:43:48 GMT Newsgroups: comp.lang.asm.x86,borland.public.tasm,alt.lang.asm,alt.2600