Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
24
25-01.md
24
25-01.md
|
|
@ -9,7 +9,7 @@ Chapter 25\
|
|||
### The Barrel Shifter, Bit Mask, and Set/Reset Mechanisms {#Heading2}
|
||||
|
||||
In the last chapter, we examined a simplified model of data flow within
|
||||
the GC portion of the VGA, featuring the latches and ALUs. Now we’re
|
||||
the GC portion of the VGA, featuring the latches and ALUs. Now we're
|
||||
ready to expand that model to include the barrel shifter, bit mask, and
|
||||
the set/reset capabilities, leaving only the write modes to be explored
|
||||
over the next few chapters.
|
||||
|
|
@ -17,9 +17,9 @@ over the next few chapters.
|
|||
### VGA Data Rotation {#Heading3}
|
||||
|
||||
Figure 25.1 shows an expanded model of GC data flow, featuring the
|
||||
barrel shifter and bit mask circuitry. Let’s look at the barrel shifter
|
||||
barrel shifter and bit mask circuitry. Let's look at the barrel shifter
|
||||
first. A barrel shifter is circuitry capable of shifting—or rotating, in
|
||||
the VGA’s case—data an arbitrary number of bits in a single operation,
|
||||
the VGA's case—data an arbitrary number of bits in a single operation,
|
||||
as opposed to being able to shift only one bit position at a time. The
|
||||
barrel shifter in the VGA can rotate incoming CPU data up to seven bits
|
||||
to the right (toward the least significant bit), with bit 0 wrapping
|
||||
|
|
@ -39,9 +39,9 @@ business) it sounds more useful than it really is. This is because the
|
|||
GC can only rotate CPU data, a task that the CPU itself is perfectly
|
||||
capable of performing. Two **OUT**s are needed to select a given
|
||||
rotation: one to set the GC Index register, and one to set the Data
|
||||
Rotate register. However, with careful programming it’s sometimes
|
||||
Rotate register. However, with careful programming it's sometimes
|
||||
possible to leave the GC Index always pointing to the Data Rotate
|
||||
register, so only one **OUT** is needed. Even so, it’s often easier
|
||||
register, so only one **OUT** is needed. Even so, it's often easier
|
||||
and/or faster to simply have the CPU rotate the data of interest CL
|
||||
times than to set the Data Rotate register. (Bear in mind that a single
|
||||
**OUT** takes from 11 to 31 cycles on a 486—and longer if the VGA is
|
||||
|
|
@ -50,16 +50,16 @@ rotate *latched* data, then there would be all sorts of useful
|
|||
applications for rotation, but, sadly, only CPU data can be rotated.
|
||||
|
||||
The drawing of bit-mapped text is one use for the barrel shifter, and
|
||||
I’ll demonstrate that application below. In general, though, don’t knock
|
||||
I'll demonstrate that application below. In general, though, don't knock
|
||||
yourself out trying to figure out how to work data rotation into your
|
||||
programs—it just isn’t all that useful in most cases.
|
||||
programs—it just isn't all that useful in most cases.
|
||||
|
||||
### The Bit Mask {#Heading4}
|
||||
|
||||
The VGA has bit mask circuitry for each of the four memory planes. The
|
||||
four bit masks operate in parallel and are all driven by the same mask
|
||||
data for each operation, so they’re generally referred to in the
|
||||
singular, as “the bit mask.” Figure 25.2 illustrates the operation of
|
||||
data for each operation, so they're generally referred to in the
|
||||
singular, as "the bit mask." Figure 25.2 illustrates the operation of
|
||||
one bit of the bit mask for one plane. This circuitry occurs eight times
|
||||
in the bit mask for a given plane, once for each bit of the byte written
|
||||
to display memory. Briefly, the bit mask determines on a bit-by-bit
|
||||
|
|
@ -74,9 +74,9 @@ given bit of the Bit Mask register is 1, then the corresponding bit of
|
|||
data from the ALUs is written to display memory for all four planes,
|
||||
while if that bit is 0, then the corresponding bit of data from the
|
||||
latches for the four planes is written to display memory unchanged. (In
|
||||
write mode 3, the actual bit mask that’s applied to data written to
|
||||
write mode 3, the actual bit mask that's applied to data written to
|
||||
display memory is the logical AND of the contents of the Bit Mask
|
||||
register and the data written by the CPU, as we’ll see in Chapter 26.)
|
||||
register and the data written by the CPU, as we'll see in Chapter 26.)
|
||||
|
||||
The most common use of the bit mask is to allow updating of selected
|
||||
bits within a display memory byte. This works as follows: The display
|
||||
|
|
@ -93,7 +93,7 @@ capabilities of the GC to draw bitmapped text at any screen location.
|
|||
The BIOS only draws characters on character boundaries; in 640x480
|
||||
graphics mode the default font is drawn on byte boundaries horizontally
|
||||
and every 16 scan lines vertically. However, with direct bitmapped text
|
||||
drawing of the sort used in Listing 25.1, it’s possible to draw any font
|
||||
drawing of the sort used in Listing 25.1, it's possible to draw any font
|
||||
of any size anywhere on the screen (and a lot faster than via DOS or the
|
||||
BIOS, as well).
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue