Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Data
Data storage
processing
Data
Control
movement
•Test instructions are used to test the value of •I/O instructions are needed to
a data word or the status of a computation transfer programs and data into
•Branch instructions are used to branch to a memory and the results of
different set of instructions depending on the computations back out to the
decision made user
+
Number of Addresses
+
Table 12.1
Utilization of Instruction Addresses
(Nonbranching Instructions)
Instruction Set Design
Very complex because it affects so many aspects of the computer system
s se s
Addre
Num
bers
Chara
cters
a l D a t a
L o g i c
+
Numbers
■ Packed decimal
■ Each decimal digit is represented by a 4-bit code with two digits stored per byte
■ To form numbers 4-bit codes are strung together, usually in multiples of 8 bits
+
Characters
■ An n-bit unit consisting of n 1-bit items of data, each item having the
value 0 or 1
+ x86 Data
Types
x86 Data Types
+
Alignment checking
All three data types can also •When the appropriate control bit is
be used for twos set, a data abort signal indicates an
complement signed integers alignment fault for attempting
unaligned access
Common
Instruction Set
Operations
(page 1 of 2)
+
Table 12.3
Common
Instruction Set
Operations
(page 2 of 2)
Table 12.4
Processor Actions for Various Types of Operations
Data Transfer
Must specify:
• Location of the source and destination
operands
Most fundamental type of • The length of data to be transferred
machine instruction must be indicated
• The mode of addressing for each
operand must be specified
Table 12.5
Examples of IBM EAS/390 Data Transfer Operations
+
■ Most machines provide the basic arithmetic operations
of add, subtract, multiply, and divide
An example of a
An example is more complex
converting editing instruction
from decimal is the EAS/390
to binary Translate (TR)
instruction
+
Input/Output
Typically these instructions are reserved for the use of the operating system
Branch
Instruction
Skip Instructions
x86
Operation Types
(With Examples
of Typical
+ Operations)
(page 1 of 2)
Table 12.8
x86
Operation Types
(With Examples
of Typical
Operations)
(page 2 of 2)
+
Call/Return Instructions
■ Common means of implementing the procedure is via the use of stack frames
■ The CALL instruction pushes the current instruction pointer value onto the stack
and causes a jump to the entry point of the procedure by placing the address of the
entry point in the instruction pointer
■ The ENTER instruction was added to the instruction set to provide direct support
for the compiler
x86 Status Flags
Table 12.10
x86
Condition
Codes for
Conditional
Jump and
SETcc
Instructions
+
x86 Single-Instruction, Multiple-Data
(SIMD) Instructions
■ 1996 Intel introduced MMX technology into its Pentium product line
■ MMX is a set of highly optimized instructions for multimedia tasks
■ Video and audio data are typically composed of large arrays of small
data types
Note: If an instruction supports multiple data types [byte (B), word (W), doubleword (D), quadword (Q)], the data
types are indicated in brackets.
ARM Operation Types
Parallel addition
Multiply Extend
and subtraction
instructions instructions
instructions
Status register
access instructions
+ Summary Instruction Sets:
Characteristics and
Functions
■ Immediate
■ Direct
■ Indirect
■ Register
■ Register indirect
■ Displacement
■ Stack
+
Addressing
Modes
+
Basic Addressing Modes
+
Immediate Addressing
■ Operand = A
■ This mode can be used to define and use constants or set initial values of
variables
■ Typically the number will be stored in twos complement form
■ The leftmost bit of the operand field is used as a sign bit
■ Advantage:
■ no memory reference other than the instruction fetch is required to obtain the
operand, thus saving one memory or cache cycle in the instruction cycle
■ Disadvantage:
■ The size of the number is restricted to the size of the address field, which, in most
instruction sets, is small compared with the word length
Direct Addressing
Was common in
earlier generations of
computers
Limitation is that it
provides only a limited
address space
+
Indirect Addressing
■ EA = (A)
■ Parentheses are to be interpreted as meaning contents of
■ Advantage:
■ For a word length of N an address space of 2N is now available
■ Disadvantage:
■ Instruction execution requires two memory references to fetch the operand
■ One to get its address and a second to get its value
■ EA = R
■ Advantages:
■ Only a small address field is needed in the instruction
■ No time-consuming memory references are required
■ Disadvantage:
■ The address space is very limited
+
Register Indirect Addressing
■ EA = (R)
■ EA = A + (R)
■ Requires that the instruction have two address fields, at least one of which
is explicit
■ The value contained in one address field (value = A) is used directly
■ The other address field refers to a register whose contents are added to A to
produce the effective address
■ Associated with the stack is a pointer whose value is the address of the top of the stack
■ The stack pointer is maintained in a register
■ Thus references to stack locations in memory are in fact register indirect addresses
■ The machine instructions need not include a memory reference but implicitly operate
on the top of the stack
x86 Addressing Mode Calculation
Table 13.2
x86 Addressing Modes
+ ARM Data Processing Instruction Addressing
and Branch Instructions
■ Branch instructions
■ The only form of addressing for branch instructions is immediate
■ Instruction contains 24 bit value
■ Shifted 2 bits left so that the address is on a word boundary
■ Effective range +/-32MB from from the program counter
Instruction Formats
■ Number of operands
■ Address range
PDP-8 Instruction Format
+
PDP-10 Instruction Format
+
Variable-Length Instructions