Remove colour attributes from body and strip most of the font tags out
This commit is contained in:
parent
7e957c0bb4
commit
c1f88ddb41
362 changed files with 1632 additions and 1706 deletions
|
|
@ -24,7 +24,7 @@
|
|||
<!--CHAPTER=13//-->
|
||||
<!--PAGES=252-254//-->
|
||||
<!--UNASSIGNED1//-->
|
||||
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
|
||||
<!--UNASSIGNED2//--></HEAD><body>
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER>
|
||||
|
|
@ -58,7 +58,7 @@ mov ax,[bx+8000h] ;get increments for next time
|
|||
<!-- END CODE SNIP //-->
|
||||
<P>I’d like to point out two fairly remarkable things. First, the single cycle that Terje saved in Listing 13.4 sped up his entire word-counting engine by 25 percent or more; Listing 13.4 is fully twice as fast as Listing 13.1—all the result of nothing more than shifting an instruction and splitting another into two operations. Second, Terje’s word-counting engine can process more than 16 million characters <I>per second</I> on a 486/33.</P>
|
||||
<P>Clever 486 optimization can pay off big. QED.</P>
|
||||
<H3><A NAME="Heading4"></A><FONT COLOR="#000077">BSWAP: More Useful Than You Might Think</FONT></H3>
|
||||
<H3><A NAME="Heading4"></A>BSWAP: More Useful Than You Might Think</H3>
|
||||
<P>There are only 3 non-system instructions unique to the 486. None is earthshaking, but they have their uses. Consider <B>BSWAP. BSWAP</B> does just what its name implies, swapping the bytes (not bits) of a 32-bit register from one end of the register to the other, as shown in Figure 13.2. (<B>BSWAP</B> can only work with 32-bit registers; memory locations and 16-bit registers are not valid operands.) The obvious use of <B>BSWAP</B> is to convert data from Intel format (least significant byte first in memory, also called <I>little endian</I>) to Motorola format (most significant byte first in memory, or <I>big endian</I>), like so:</P>
|
||||
<!-- CODE SNIP //-->
|
||||
<PRE>
|
||||
|
|
@ -69,7 +69,7 @@ stosd
|
|||
<!-- END CODE SNIP //-->
|
||||
<P><B>BSWAP</B> can also be useful for reversing the order of pixel bits from a bitmap so that they can be rotated 32 bits at a time with an instruction such as <B>ROR EAX,1</B>. Intel’s byte ordering for multiword values (least-significant byte first) loads pixels in the wrong order, so far as word rotation is concerned, but <B>BSWAP</B> can take care of that.</P>
|
||||
<P><A NAME="Fig2"><!-- </A><A HREF="javascript:displayWindow('images/13-02.jpg',409,245 )"> --><IMG SRC="images/13-02.jpg"><BR><!-- </A>
|
||||
<BR><A HREF="javascript:displayWindow('images/13-02.jpg',409,245)"> --><FONT COLOR="#000077"><B>Figure 13.2</B></FONT></A> <I>BSWAP in operation.</I>
|
||||
<BR><A HREF="javascript:displayWindow('images/13-02.jpg',409,245)"> --><B>Figure 13.2</B></A> <I>BSWAP in operation.</I>
|
||||
</P>
|
||||
<P>As it turns out, though, <B>BSWAP</B> is also useful in an unexpected way, having to do with making efficient use of the upper half of 32-bit registers. As any assembly language programmer knows, the x86 register set is too small; or, to phrase that another way, it sure would be nice if the register set were bigger. As any 386/486 assembly language programmer knows, there are many cases in which 16 bits is plenty. For example, a 16-bit scan-line counter generally does the trick nicely in a video driver, because there are <I>very</I> few video devices with more than 65,535 addressable scan lines. Combining these two observations yields the obvious conclusion that it would be great if there were some way to use the upper and lower 16 bits of selected 386 registers as separate 16-bit registers, effectively increasing the available register space.</P>
|
||||
<P>Unfortunately, the x86 instruction set doesn’t provide any way to work directly with only the upper half of a 32-bit register. The next best solution is to rotate the register to give you access in the lower 16 bits to the half you need at any particular time, with code along the lines of that in Listing 13.5. Having to rotate the 16-bit fields into position certainly isn’t as good as having direct access to the upper half, but surely it’s better than having to get the values out of memory, isn’t it?</P>
|
||||
|
|
@ -102,7 +102,7 @@ looptop:
|
|||
|
||||
<hr width="90%" size="1" noshade>
|
||||
<div align="center">
|
||||
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book © 2001 Michael Abrash</font>
|
||||
Graphics Programming Black Book © 2001 Michael Abrash
|
||||
</div>
|
||||
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
|
||||
<!-- reference_subfoot = footer -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue