Hardware Reference
In-Depth Information
with it an interrupt enable bit. If the device enable is set and the global interrupt
enable I bit is set, the device can interrupt the processor.
The stack pointer SP holds the current address in data memory where PUSH
and POP instructions will access their data, similar to the similarly named instruc-
tion in the Java JVM of Chap. 4. The stack pointer is located in I/O memory at ad-
dress 80. A single 8-bit memory byte is too small to address 1024 bytes of data
memory, so the stack pointer is composed of two consecutive locations in memory,
forming a 16-bit address.
5.2 DATA TYPES
All computers need data. In fact, for many computer systems, the whole pur-
pose is to process financial, commercial, scientific, engineering, or other data. The
data have to be represented in some specific form inside the computer. At the ISA
level, a variety of different data types are used. These will be explained below.
A key issue is whether there is hardware support for a particular data type.
Hardware support means that one or more instructions expect data in a particular
format, and the user is not free to pick a different format. For example, account-
ants have the peculiar habit of writing negative numbers with the minus sign to the
right of the number rather than to the left, where computer scientists put it. Sup-
pose that in an effort to impress his boss, the head of the computer center at an ac-
counting firm changed all the numbers in all the computers to use the rightmost bit
(instead of the leftmost bit) as the sign bit. This would no doubt make a big
impression on the boss—because all the software would instantly cease to function
correctly. The hardware expects a certain format for integers and does not work
properly when given anything else.
Now consider another accounting firm, this one just having gotten a contract to
verify the federal debt (how much the U.S. government owes everyone). Using
32-bit arithmetic would not work here because the numbers involved are larger
than 2 32 (about 4 billion). One solution is to use two 32-bit integers to represent
each number, giving 64 bits in all. If the machine does not support double-preci-
sion numbers, all arithmetic on them will have to be done in software, but the two
parts can be in either order since the hardware does not care. This is an example of
a data type without hardware support and thus without a required hardware repres-
entation. In the following sections we will look at data types that are supported by
the hardware, and thus for which specific formats are required.
5.2.1 Numeric Data Types
Data types can be divided into two categories: numeric and nonnumeric. Chief
among the numeric data types are the integers. They come in many lengths, typi-
cally 8, 16, 32, and 64 bits. Integers count things (e.g., the number of screwdrivers
 
 
 
Search WWH ::




Custom Search