Chapter 6 - P - I: Instruction Sets: Characteristics and Functions
Chapter 6 - P - I: Instruction Sets: Characteristics and Functions
+ Chapter 6_P_I
Instruction Sets:
Characteristics and
Functions
+ 2
Machine Instruction
Characteristics
Instruction
Operation code Source operand
(opcode) reference
• Specifies the • The operation may
operation to be involve one or more
performed. The source operands,
operation is specified that is, operands that
by a binary code, are inputs for the
known as the operation
operation code, or
opcode
Instruction Representation
Within the computer each instruction is represented by
a sequence of bits
The instruction is divided into fields, corresponding to
the constituent elements of the instruction
+ 7
Instruction Representation
Opcodes are represented by abbreviations
called mnemonics
Examples include:
ADD Add
SUB Subtract
MUL Multiply
DIV Divide
LOAD Load data from memory
STOR Store data to memory
Data
Control movemen
t
• Test instructions are used to test the • I/O instructions are
value of a data word or the status of needed to transfer
a computation programs and data into
• Branch instructions are used to memory and the results
branch to a different set of of computations back out
instructions depending on the to the user
decision made
Table 6.1 9
Types of Operands
sse s
d re
Ad Num
bers
Char
acte
rs i c al
Log
Data
+ Numbers 13
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
+ 14
Characters
A common form of data is text or character strings
Textual data in character form cannot be easily stored
or transmitted by data processing and communications
systems because they are designed for binary data
Most commonly used character code is the
International Reference Alphabet (IRA)
Referred to in the United States as the American Standard
Code for Information Interchange (ASCII)
Logical Data
Normally, each word or other addressable unit (byte, halfword, and so
on) is treated as a single unit of data. It is sometimes useful, however,
to consider an n-bit unit as consisting of n 1-bit items of data, each item
having the value 0 or 1. When data are viewed this way, they are
considered to be logical data.
An n-bit unit consisting of n 1-bit items of data, each item having the
value 0 or 1
Two advantages to bit-oriented view:
Memory can be used most efficiently for storing an array of Boolean or binary
data items in which each item can take on only the values 1 (true) and 0
(false)
To manipulate the bits of a data item
If floating-point operations are implemented in software, we need to be
able to shift significant bits in some operations
To convert from IRA to packed decimal, we need to extract the rightmost 4
bits of each byte
+ 16
Table
12.2
x86
Data
Types
18
+ 19
Single-Instruction-Multiple-Data
(SIMD) Data Types
Introduced to the x86 architecture as part of the extensions of
the instruction set to optimize performance of multimedia
applications
These extensions include MMX (multimedia extensions) and SSE
(streaming SIMD extensions)
Data types:
Packed byte and packed byte integer: Bytes packed into a 64-bit quadword or
128-bit double quadword, interpreted as a bit field or as an integer
Packed word and packed word integer: 16-bit words packed into a 64-bit quad-
word or 128-bit double quadword, interpreted as a bit field or as an integer
Packed doubleword and packed doubleword integer: 32-bit doublewords
packed into a 64-bit quadword or 128-bit double quadword, interpreted as a bit
field or as an integer
Packed quadword and packed qaudword integer: Two 64-bit quadwords
packed into a 128-bit double quadword, interpreted as a bit field or as an integer
Packed single-precision floating-point and packed double-precision floating- point: Four 32-bit
floating-point or two 64-bit floating-point values packed into a 128-bit double quadword
+ 20
ARM Processors
Alignment checking
All three data types • When the appropriate
can also be used for control bit is set, a data
twos complement abort signal indicates an
alignment fault for
signed integers attempting unaligned
access
Unaligned access
• When this option is
For all three data enabled, the processor uses
types an unsigned one or more memory
interpretation is accesses to generate the
supported in which the required transfer of
adjacent bytes
value represents an transparently to the
unsigned, nonnegative programmer
integer
22
A state bit (E-bit) in the system control register is set and cleared under program control using the
SETEND instruction. The E-bit defines which endian to load and store data
+ 23
TYPES OF OPERATIONS
Table
12.3
Common
Instruction
Set
Operations
(page 1 of
2)
25
Table 12.3
Common
Instruction Set
Operations
(page 2 of 2)
Table 12.4 26
Must specify:
• Location of the
Most source and
fundamental destination
operands
type of • The length of
machine data to be
instruction is transferred must
the data be indicated
• The mode of
transfer
addressing for
instruction. each operand
must be
specified
Table 12.5 28
Table 12.6
Basic Logical Operations
31
32
Table 12.7
Instructions
that change
the format or Conversion
operate on the
format of data
An example of
a more
complex
editing
An example is instruction is
converting from
decimal to
the EAS/390
binary Translate (TR)
Or instruction
translating from
EBCDIC to IRA
+ 34
Input/Output
Transfer of Control
BRO X Branch to location X if overflow occurs BRE R1, R2, X Branch to X if contents of R1 = contents of R
Skip Instructions 38
Example is the
increment-and-skip-if-
zero (ISZ) instruction
The increment-and-
skip-if-zero (ISZ)
instruction
+ 39
Table
12.9
x86
Condition
Codes
for
Conditional
Jump
and
SETcc
Instructions
ARM Operation Types 46
Data-
Load and store Branch
processing
instructions instructions
instructions
Parallel
Multiply addition and Extend
instructions subtraction instructions
instructions
Status register
access
instructions
47
Table
12.11
ARM
Conditions
for
Conditional
Instruction
Execution
The ARM architecture
defines four condition
flags that are stored in
the program status
There are two unusual aspects to the use of condition codes in ARM:
register: N, Z, C, and
- All instructions, not just branch instructions, include a condition code field, which means V (Negative, Zero,
that virtually all instructions may be conditionally executed. Any combination of flag Carry and Overflow
settings except 1110 or 1111 in an instruction’s condition code field signifies that the
instruction will be executed only if the condition is met.
- All data processing instructions (arithmetic, logical) includes an S bit that signifies
whether the instruction updates the condition flags.
+ Summary Instruction Sets:
48
Characteristics and
Chapter 6 Functions
Machine instruction Intel x86 and ARM data types
characteristics
Types of operations
Elements of a machine
instruction Data transfer
Instruction representation Arithmetic
Instruction types Logical
Number of addresses Conversion
Instruction set design Input/output
Types of operands System control
Numbers Transfer of control
Characters
Logical data
Intel x86 and ARM operation
types