🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4160

Re: 386 and EGA-card

#4160
From: Mark Lord
Date: Mon, 07 Jan 1991 17:44
33 lines
1781 bytes
In article <CMM.0.88.663249658.sverrehu@ome.ifi.uio.no> sverrehu@ifi.uio.no (Sverre H Huseby) writes:
<I have tried clearing the EGA graphics screen (mode 10h)
<in the following two ways:
<
<    8086:
<      xor ax, ax
<      mov cx, NUM_BYTES / 2
<      rep stosw
<
<    80386:
<      xor eax, eax
<      mov cx, NUM_BYTES / 4
<      rep stosd
<
<The 386-routine takes almost the same amount of time as
<does the 8086-routine.
<
<Why???

Because the hardware interface to your EGA card's memory is only 8-bits wide.
Thus, both of these loops generate exactly NUM_BYTES writes to the EGA memory,
with the cpu converting your 16/32 bit writes to multiple 8-bit writes.

The 386 loop will still be slightly faster, due to less overhead for the loop,
since it only runs half the count of the 8086 loop.  But since EGA memory tends
to involve wait states when accessing, and also since both processors lock
the loop code inside the pre-fetch queue, the slight savings in loop overhead
are not significant compared to the very slow access to the EGA memory.
-- 
 ___Mark S. Lord__________________________________________
| ..uunet!bnrgate!mlord%bmerh724 | Climb Free Or Die (NH) |
| MLORD@BNR.CA   Ottawa, Ontario | Personal views only.   |
|________________________________|________________________|
Technical Details
Message-ID: <5172@bwdls58.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!mlord
References: <CMM.0.88.663249658.sverrehu@ome.ifi.uio.no>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!mlord
From: mlord@bwdls58.bnr.ca (Mark Lord)
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.misc
Subject: Re: 386 and EGA-card
Message-ID: <5172@bwdls58.UUCP>
Date: 7 Jan 91 17:44:51 GMT
References: <CMM.0.88.663249658.sverrehu@ome.ifi.uio.no>
Sender: mlord@bwdls58.UUCP
Reply-To: mlord@bwdls58.bnr.ca (Mark Lord)
Organization: Bell-Northern Research, Ottawa, Canada
Lines: 33