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: Pushing the 286 and 386</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: Pushing the 286 and 386</title>
<meta name="chapter" content="11" />
<meta name="pages" content="205-210" />
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
</head>
<body>
@ -37,16 +30,16 @@
<p><br /></p>
<h2><a id="Heading1"></a>Chapter 11<br />
<h2 id="Heading1">Chapter 11<br />
Pushing the 286 and 386</h2>
<h3><a id="Heading2"></a>New Registers, New Instructions, New Timings, New Complications</h3>
<h3 id="Heading2">New Registers, New Instructions, New Timings, New Complications</h3>
<p>This chapter, adapted from my earlier book <i>Zen of Assembly Language</i> (1989; now out of print), provides an overview of the 286 and 386, often contrasting those processors with the 8088. At the time I originally wrote this, the 8088 was the king of processors, and the 286 and 386 were the new kids on the block. Today, of course, all three processors are past their primes, but many millions of each are still in use, and the 386 in particular is still well worth considering when optimizing software.</p>
<p>This chapter provides an interesting look at the evolution of the x86 architecture, to a greater degree than you might expect, for the x86 family came into full maturity with the 386; the 486 and the Pentium are really nothing more than faster 386s, with very little in the way of new functionality. In contrast, the 286 added a number of instructions, respectable performance, and protected mode to the 8088&rsquo;s capabilities, and the 386 added more instructions and a whole new set of addressing modes, and brought the x86 family into the 32-bit world that represents the future (and, increasingly, the present) of personal computing. This chapter also provides insight into the effects on optimization of the variations in processors and memory architectures that are common in the PC world. So, although the 286 and 386 no longer represent the mainstream of computing, this chapter is a useful mix of history lesson, x86 overview, and details on two workhorse processors that are still in wide use.</p>
<h4 align="left"><a id="Heading3"></a>Family Matters</h4>
<h4 align="left" id="Heading3">Family Matters</h4>
<p>While the x86 family is a large one, only a few members of the family&mdash;which includes the 8088, 8086, 80188, 80186, 286, 386SX, 386DX, numerous permutations of the 486, and now the Pentium&mdash;really matter.</p>
@ -60,21 +53,21 @@
<p>This leaves us with just two processors: the 286 and the 386. Each was <i>the</i> PC standard in its day. The 286 is no longer used in new systems, but there are millions of 286-based systems still in daily use. The 386 is still being used in new systems, although it&rsquo;s on the downhill leg of its lifespan, and it is in even wider use than the 286. The future clearly belongs to the 486 and Pentium, but the 286 and 386 are still very much a part of the present-day landscape.</p>
<h4 align="left"><a id="Heading4"></a>Crossing the Gulf to the 286 and the 386</h4>
<h4 align="left" id="Heading4">Crossing the Gulf to the 286 and the 386</h4>
<p>Apart from vastly improved performance, the biggest difference between the 8088 and the 286 and 386 (as well as the later Intel CPUs) is that the 286 introduced protected mode, and the 386 greatly expanded the capabilities of protected mode. We&rsquo;re only going to talk about real-mode operation of the 286 and 386 in this book, however. Protected mode offers a whole new memory management scheme, one that isn&rsquo;t supported by the 8088. Only code specifically written for protected mode can run in that mode; it&rsquo;s an alien and hostile environment for MS-DOS programs.</p>
<p>In particular, segments are different creatures in protected mode. They&rsquo;re <i>selectors</i>&mdash;indexes into a table of segment descriptors&mdash;rather than plain old registers, and can&rsquo;t be set to arbitrary values. That means that segments can&rsquo;t be used for temporary storage or as part of a fast indivisible 32-bit load from memory, as in</p><!-- CODE SNIP //-->
<p>In particular, segments are different creatures in protected mode. They&rsquo;re <i>selectors</i>&mdash;indexes into a table of segment descriptors&mdash;rather than plain old registers, and can&rsquo;t be set to arbitrary values. That means that segments can&rsquo;t be used for temporary storage or as part of a fast indivisible 32-bit load from memory, as in</p>
<pre>
les ax,dword ptr [LongVar]
mov dx,es
</pre><!-- END CODE SNIP //-->
</pre>
<p>which loads <b>LongVar</b> into DX:AX faster than this:</p><!-- CODE SNIP //-->
<p>which loads <b>LongVar</b> into DX:AX faster than this:</p>
<pre>
mov ax,word ptr [LongVar]
mov dx,word ptr [LongVar+2]
</pre><!-- END CODE SNIP //-->
</pre>
<p>Protected mode uses those altered segment registers to offer access to a great deal more memory than real mode: The 286 supports 16 megabytes of memory, while the 386 supports 4 gigabytes (4K megabytes) of physical memory and 64 <i>terabytes</i> (64K gigabytes!) of virtual memory.</p>
@ -82,7 +75,7 @@ mov dx,word ptr [LongVar+2]
<p>In short, taken as a whole, protected mode programming is a different kettle of fish altogether from what I&rsquo;ve been describing in this book. There&rsquo;s certainly a knack to optimizing specifically for protected mode under a given operating system...but it&rsquo;s not what we&rsquo;ve been learning, and now is not the time to pursue it further. In general, though, the optimization strategies discussed in this book still hold true in protected mode; it&rsquo;s just issues specific to protected mode or a particular operating system that we won&rsquo;t discuss.</p>
<h4 align="left"><a id="Heading5"></a>In the Lair of the Cycle-Eaters, Part II</h4>
<h4 align="left" id="Heading5">In the Lair of the Cycle-Eaters, Part II</h4>
<p>Under the programming interface, the 286 and 386 differ considerably from the 8088. Nonetheless, with one exception and one addition, the cycle-eaters remain much the same on computers built around the 286 and 386. Next, we&rsquo;ll review each of the familiar cycle-eaters I covered in Chapter 4 as they apply to the 286 and 386, and we&rsquo;ll look at the new member of the gang, the data alignment cycle-eater.</p>
@ -105,10 +98,6 @@ mov dx,word ptr [LongVar+2]
<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>