Information Technology Reference
In-Depth Information
TABLE 2.3 Some Common Data Movement Operations
Data movement
operation
Meaning
MOVE
Move data (a word or a block) from a given source
(a register or a memory) to a given destination
LOAD
Load data from memory to a register
STORE
Store data into memory from a register
PUSH
Store data from a register to stack
POP
Retrieve data from stack into a register
This instruction moves the content of register R i to register R j . The effect of the instruc-
tion is to override the contents of the (destination) register R j without changing the con-
tents of the (source) register R i . Data movement instructions include those used to
move data to (from) registers from (to) memory. These instructions are usually referred
to as the load and store instructions, respectively. Examples of the two instructions are
LOAD 25838, R j
STORE R i , 1024
The first instruction loads the content of the memory location whose address is 25838
into the destination register R j . The content of the memory location is unchanged by
executing the LOAD instruction. The STORE instruction stores the content of the
source register R i into the memory location 1024. The content of the source register
is unchanged by executing the STORE instruction. Table 2.3 shows some common
data transfer operations and their meanings.
2.3.2. Arithmetic and Logical Instructions
Arithmetic and logical instructions are those used to perform arithmetic and logical
manipulation of registers and memory contents. Examples of arithmetic instructions
include the ADD and SUBTRACT instructions. These are
ADD R 1 ,R 2 ,R 0
SUBTRACT R 1 ,R 2 ,R 0
The first instruction adds the contents of source registers R 1 and R 2 and stores the
result in destination register R 0 . The second instruction subtracts the contents of
the source registers R 1 and R 2 and stores the result in the destination register R 0 .
The contents of the source registers are unchanged by the ADD and the SUBTRACT
instructions. In addition to the ADD and SUBTRACT instructions, some machines
have MULTIPLY and DIVIDE instructions. These two instructions are expensive
to implement and could be substituted by the use of repeated addition or repeated
subtraction. Therefore, most modern architectures do not have MULTIPLY or
Search WWH ::




Custom Search