Article View: comp.lang.asm.x86
Article #113Re: Thick
From: Quad
Date: Thu, 11 Mar 1999 00:00
Date: Thu, 11 Mar 1999 00:00
52 lines
3145 bytes
3145 bytes
I assume that the text and video modes are respectively 80x25 (mode 3h) and
320x200 (mode 13h).
you should know that the video memory segment is 0b800h, so pointing with,
say, the registers es:di at 0b800h:0000h then sending bytes (value 0) at
this location will clear the screen (you have to move 4000 bytes :
80x25=2000 and 2000x2=4000 because each location on screen takes 2 bytes,
one for the character and the other is for the attribute). why sending 0s ??
because 0 are for the null character and the color black. here's a sample
code of how to do that... (with the basic 8086 instructions set)
mov ax, 0b800h ; make es point at seg b800h
mov es, ax
xor di, di ; zero di (offset within the seg)
xor al, al ; zero al, this is the byte to send
mov cx, 4000 ; we move 4000 bytes
repnz stosb ; repeat while not zero, store bytes at es:di
in order to clear the screen in graphic mode, you just have to do the same
thing, with the change that es:di now points to 0a000h:0000h and that we
move not 4000 bytes but 64000 (320 x 200 = 64000 bytes). then you send zeros
again...!
the function 0ah for int 21h allows the user to fill some buffer with a
string, ending when the user press 'enter'. you have to prepare the buffer
yourself in memory before calling this function. this is a special
structured buffer,
byte size description
0 1 maximum characters buffer can hold (N)
1 1 (on call) number of chars
from last input which may be recalled
(on ret) number of chars read, excluding the carriage
return
2 N Bytes the input buffer itself, including the CR
when interrupting,
ah = 0ah
ds:dx = address of buffer
I hope these informations will help you !
Quad
quadid@videotron.ca
>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.
>
>
Technical Details
Message-ID:
<7c8o9u$ar1$1@winter.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7c6u0d$cue$1@winter.news.rcn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7d8d,be6aba38dbcf8999 X-Google-Attributes: gidf7d8d,public X-Google-Thread: 10bb54,be6aba38dbcf8999 X-Google-Attributes: gid10bb54,public X-Google-Thread: feaef,be6aba38dbcf8999 X-Google-Attributes: gidfeaef,public X-Google-Thread: 114917,be6aba38dbcf8999 X-Google-Attributes: gid114917,public From: "Quad" <quadid@videotron.ca> Subject: Re: Thick Date: 1999/03/11 Message-ID: <7c8o9u$ar1$1@winter.news.rcn.net> X-Deja-AN: 453824741 Approved: <johnfine@erols.com> References: <7c6u0d$cue$1@winter.news.rcn.net> X-Authentication-Warning: backdraft.philabs.research.philips.com: smap set sender to <news@weber.videotron.net> using -f X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@rcn.com X-Trace: GPjQJCrFOwdQOWM2Tjud2l5Y8+auB5TtFAoj0Jxi5Js= NNTP-Posting-Date: 11 Mar 1999 15:42:54 GMT Newsgroups: comp.lang.asm.x86,borland.public.tasm,alt.lang.asm,alt.2600