Hardware Reference
In-Depth Information
Boolean values are also important. A Boolean value can take on one of two
values: true or false. In theory, a single bit can represent a Boolean, with 0 as false
and 1 as true (or vice versa). In practice, a byte or word is used per Boolean value
because individual bits in a byte do not have their own addresses and thus are hard
to access. A common system uses the convention that 0 means false and every-
thing else means true.
The one situation in which a Boolean value is normally represented by 1 bit is
when there is an entire array of them, so a 32-bit word can hold 32 Boolean values.
Such a data structure is called a bit map and occurs in many contexts. For ex-
ample, a bit map can be used to keep track of free blocks on a disk. If the disk has
n blocks, then the bit map has n bits.
Our last data type is the pointer, which is just a machine address. We have al-
ready seen pointers repeatedly. In the Mic- x machines, SP , PC , LV , and CPP are all
examples of pointers. Accessing a variable at a fixed distance from a pointer,
which is the way ILOAD works, is extremely common on all machines. While
pointers are useful, they are also the source of a vast number of programming
errors, often with very serious consequences. They must be used with great care.
5.2.3 Data Types on the Core i7
The Core i7 supports signed two's complement integers, unsigned integers, bi-
nary coded decimal numbers, and IEEE 754 floating-point numbers, as listed in
Fig. 5-6. Due to its origins as a humble 8-bit/16-bit machine, it handles integers of
these lengths as well as 32-bits, with numerous instructions for doing arithmetic,
Boolean operations, and comparisons on them. The processor can optionally be run
in 64-bit mode which also supports 64-bit registers and operations. Operands do
not have to be aligned in memory, but better performance is achieved if word ad-
dresses are multiples of 4 bytes.
Type
8 Bits
16 Bits
32 Bits
64 Bits
Signed integer
×
×
×
× (64-bit)
Unsigned integer
×
×
×
×
(64-bit)
Binary coded decimal integer
×
Floating point
×
×
Figure 5-6. The Core i7 numeric data types. Supported types are marked with ×.
Types marked with ''64-bit'' are only supported in 64-bit mode.
The Core i7 is also good at manipulating 8-bit ASCII characters: there are spe-
cial instructions for copying and searching character strings. These instructions
can be used both with strings whose length is known in advance and with strings
whose end is marked. They are often used in string manipulation libraries.
 
 
 
Search WWH ::




Custom Search