Strip comments and inline ids onto h*

This commit is contained in:
James Gregory 2013-12-30 15:11:04 +11:00
commit 0f5f617adb
362 changed files with 2519 additions and 6694 deletions

View file

@ -10,16 +10,9 @@
<meta name="vspubdate" content="07/01/97" />
<meta name="vscategory" content="Web and Software Development: Game Development,Web and Software Development: Graphics and Multimedia Development" />
<title>Michael Abrash's Graphics Programming Black Book Special Edition: In the Lair of the Cycle-Eaters</title><!-- HEADER -->
<!-- Empty Reference Subhead -->
<!--ISBN=1576101746//-->
<!--TITLE=Michael Abrash's Graphics Programming Black Book Special Edition//-->
<!--AUTHOR=Michael Abrash//-->
<!--PUBLISHER=The Coriolis Group, Inc.//-->
<title>Michael Abrash's Graphics Programming Black Book Special Edition: In the Lair of the Cycle-Eaters</title>
<meta name="chapter" content="4" />
<meta name="pages" content="104-106" />
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
</head>
<body>
@ -39,7 +32,7 @@
<p>The answer varies considerably depending on what display adapter and what display mode we&rsquo;re talking about. The display adapter cycle-eater is worst with the Enhanced Graphics Adapter (EGA) and the original Video Graphics Array (VGA). (Many VGAs, especially newer ones, insert many fewer wait states than IBM&rsquo;s original VGA. On the other hand, Super VGAs have more bytes of display memory to be accessed in high-resolution mode.) While the Color/Graphics Adapter (CGA), Monochrome Display Adapter (MDA), and Hercules Graphics Card (HGC) all suffer from the display adapter cycle-eater as well, they suffer to a lesser degree. Since the VGA represents the base standard for PC graphics now and for the foreseeable future, and since it is the hardest graphics adapter to wring performance from, we&rsquo;ll restrict our discussion to the VGA (and its close relative, the EGA) for the remainder of this chapter.</p>
<h4 align="left"><a id="Heading21"></a>The Impact of the Display Adapter Cycle-Eater</h4>
<h4 align="left" id="Heading21">The Impact of the Display Adapter Cycle-Eater</h4>
<p>Even on the EGA and VGA, the effect of the display adapter cycle-eater depends on the display mode selected. In text mode, the display adapter cycle-eater is rarely a major factor. It&rsquo;s not that the cycle-eater isn&rsquo;t present; however, a mere 4,000 bytes control the entire text mode display, and even with the display adapter cycle-eater it just doesn&rsquo;t take that long to manipulate 4,000 bytes. Even if the display adapter cycle-eater were to cause the 8088 to take as much as 5&micro;s per display memory access&mdash;more than five times normal&mdash;it would still take only 4,000x 2x 5&micro;s, or 40 &micro;s, to read and write every byte of display memory. That&rsquo;s a lot of time as measured in 8088 cycles, but it&rsquo;s less than the blink of an eye in human time, and video performance only matters in human time. After all, the whole point of drawing graphics is to convey visual information, and if that information can be presented faster than the eye can see, that is by definition fast enough.</p>
@ -51,7 +44,7 @@
<p>That sounds pretty serious, but we did make an unfounded assumption about memory access speed. Let&rsquo;s get some hard numbers. Listing 4.11 accesses display memory at the 8088&rsquo;s maximum speed, by way of a <b>REP MOVSW</b> with display memory as both source and destination. The code in Listing 4.11 executes in 3.18 &micro;s per access to display memory&mdash;not as long as we had assumed, but a long time nonetheless.</p>
<p><b>LISTING 4.11 LST4-11.ASM</b></p><!-- CODE //-->
<p><b>LISTING 4.11 LST4-11.ASM</b></p>
<pre>
; Times speed of memory access to Enhanced Graphics
; Adapter graphics mode display memory at A000:0000.
@ -81,11 +74,11 @@
;
mov ax,0003h
int 10h ;return to text mode
</pre><!-- END CODE //-->
</pre>
<p>For comparison, let&rsquo;s see how long the same code takes when accessing normal system RAM instead of display memory. The code in Listing 4.12, which performs a <b>REP MOVSW</b> from the code segment to the code segment, executes in 1.39 &micro;s per display memory access. That means that on average, 1.79 &micro;s (more than 8 cycles!) are lost to the display adapter cycle-eater on each access. In other words, the display adapter cycle-eater can <i>more than double</i> the execution time of 8088 code!</p>
<p><b>LISTING 4.12 LST4-12.ASM</b></p><!-- CODE //-->
<p><b>LISTING 4.12 LST4-12.ASM</b></p>
<pre>
; Times speed of memory access to normal system
; memory.
@ -105,7 +98,7 @@
; is just to measure memory access
; times
call ZTimerOff
</pre><!-- END CODE //-->
</pre>
<p>Bear in mind that we&rsquo;re talking about a worst case here; the impact of the display adapter cycle-eater is proportional to the percent of time a given code sequence spends accessing display memory.</p>
@ -126,10 +119,6 @@
<div align="center">
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div><!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->
<!-- BEGIN SUB FOOTER -->
<!-- END FOOTER -->
</div>
</body>
</html>