Hardware Reference
In-Depth Information
Also, every register (including local variable pointer, stack pointer, and program
counter) should be usable wherever a register is called for. More complicated ad-
dressing modes may reduce the number of instructions, but at the expense of intro-
ducing sequences of operations that cannot easily be parallelized with other
sequential operations.
We have now completed our study of the various trade-offs possible between
opcodes and addresses, and various forms of addressing. When approaching a new
computer, you should examine the instructions and addressing modes not only to
see which ones are available but also to understand why those choices were made
and what the consequences of alternative choices would have been.
5.5 INSTRUCTION TYPES
ISA-level instructions can be approximately divided into a half-dozen groups
that are relatively similar from machine to machine, even though they may differ in
the details. In addition, every computer has a few unusual instructions, added for
compatibility with previous models, or because the architect had a brilliant idea, or
possibly because a government agency paid the manufacturer to include it. We
will try to briefly cover all the common categories below, without any attempt at
being exhaustive.
5.5.1 Data Movement Instructions
Copying data from one place to another is the most fundamental of all opera-
tions. By copying we mean the creating of a new object, with the identical bit pat-
tern as the original. This use of the word ''movement'' is somewhat different from
its normal usage in English. When we say that Marvin Mongoose has moved from
New York to California, we do not mean that an identical copy of Mr. Mongoose
was created in California and that the original is still in New York. When we say
that the contents of memory location 2000 have been moved to some register, we
always mean that an identical copy has been created there and that the original is
still undisturbed in location 2000. Data movement instructions would better be
called ''data duplication'' instructions, but the term ''data movement'' is already
established.
There are two reasons for copying data from one location to another. One is
fundamental: the assignment of values to variables. The assignment
A=B
is implemented by copying the value at memory address B to location A because
the programmer has said to do this. The second reason is to stage the data for ef-
ficient access and use. As we have seen, many instructions can access variables
only when they are available in registers. Since there are two possible sources for
 
 
 
Search WWH ::




Custom Search