Chapter 12 - Instruction Set and Functions
Chapter 12 - Instruction Set and Functions
Instruction Sets:
Chapter 12
Characteristics and Functions
After
studying this chapter, you should
be able to:
Present an overview of essential
characteristics of machine instructions.
Describe the types of operands used in
typical machine instruction sets.
3
+
Contents
Characteristics
• Movement of
• Arithmetic instructions data into or out of
for processing numeric register and or
data memory locations
• Logic instructions
operate on the bits of a
word capabilities for
processing any other data
type
Data Data
processing storage
Data
Control
• Test the value of a data movement
word or the status of a • I/O instructions
computation are needed to
• Branching to a different transfer programs
set of instructions and data into
depending on the memory and the
decision made results of
computations back
out to the user
+ Number of Addresses 10
Table 12.1
11
+
Utilization of Instruction Addresses
(Nonbranching Instructions)
3
5
2
1
Instruction Set Design 12
They
may
be
14
+
Numbers
All machine languages include numeric data types
Another
code used to encode characters is the
Extended Binary Coded Decimal Interchange Code
EBCDIC is used on IBM mainframes
16
+
How to create a packed number:
“69”: Packed 69:
0011 0110 0011 1001 0110 1001
+ Logical Data 17
Data transfer
Arithmetic
Logical
Conversion
I/O
System control
Transfer of control
+Table 12.3 Common Instruction Set Operations (page 1 of 3)
Table 12.3
Common Instruction
+ Set Operations
(page 2 of 3)
Table 12.3
Common Instruction
+ Set Operations
(page 3 of 3)
Table 12.4 22
Processor Actions for Various Types of Operations
Data Transfer 23
Must specify:
Most • Location of the source and
destination operands
fundamental type • The length of data to be
of machine transferred must be
indicated
instruction • The mode of addressing
for each operand must be
specified
Table 12.5 : Examples of IBM EAS/390 Data Transfer Operations
24
Most machines provide the basic arithmetic 25
+
operations of add, subtract, multiply, and
divide
These are provided for signed integer (fixed-
point) numbers
Often they are also provided for floating-point
and packed decimal numbers
Other possible operations include a variety of
single-operand instructions:
Absolute Arithmetic
Take the absolute value of the operand
Negate
Negate the operand
Increment
Add 1 to the operand
Decrement
Subtract 1 from the operand
Logical 26
Shift and
Rotate
Operations
Figure 12.6-
Shift and Rotate
Operations
Table 12.7 28
+
29
Instructions
that change
the format or
operate on
Conversion
the format of
data
An example of a
more complex
An example is editing
converting from instruction is the
decimal to EAS/390
binary Translate (TR)
instruction (page
425)
+ Input/Output 30
Self-contained
codes that is incorporated into a
larger program
At any point in the program the procedure may be invoked, or
called
Processor is instructed to go and execute the entire procedure
and then return to the point from which the call took place
Implement
Nested
Procedures
Stack Frame Growth 38
Using Sample Procedures P and Q
Stack frame:
Data can be
stacked just
before a
procedure is
called: (1)
return address,
(2) parameters
(3) Caller stack
frame
x 12.2 What types of locations can hold source and destination operands?
12.3 If an instruction contains four addresses, what might be the purpose of each
e address?
12.4 List and briefly explain five important instruction set design issues.
r 12.5 What types of operands are typical in machine instruction sets?
c 12.6 What is the relationship between the IRA character code and the packed
decimal representation?
i 12.7 What is the difference between an arithmetic shift and a logical shift?
12.9 List and briefly explain two common ways of generating the condition to be
e tested in a conditional branch instruction.