Instruction Set Architecture
Instruction Set Architecture
Chapter 5 – The
Instruction Set
Architecture
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-2 Chapter 4 - The Instruction Set Architecture
Chapter Contents
Hardware Components of the Instruction Set
Architecture
ARC, A RISC Computer
Pseudo-Operations
Synthetic Instructions
Examples of Assembly Language Programs
Accessing Data in Memory—Addressing Modes
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-3 Chapter 4 - The Instruction Set Architecture
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-4 Chapter 4 - The Instruction Set Architecture
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-5 Chapter 4 - The Instruction Set Architecture
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-6 Chapter 4 - The Instruction Set Architecture
• When multi-byte words are used, two choices for the order
in which the bytes are stored in memory are: most
significant byte at lowest address, referred to as big-
endian, or least significant byte stored at lowest address,
referred to as little-endian.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-7 Chapter 4 - The Instruction Set Architecture
• Thus the byte address 0x00001003 contains the byte 0xDD. Since
this is a big-endian machine (the big end is stored at the lowest
address) the word stored at address 0x00001000 is 0xAABBCCDD.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4-9 Chapter 4 - The Instruction Set Architecture
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
10
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
11
An Example Datapath
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
13
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
14
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
Simple Example: Add Two
4- Chapter 4 - The Instruction Set Architecture
15
Numbers
• The figure shows a simple program fragment using our ld, st, and
add instructions. This fragment is equivalent to the C statement:
z = x + y;
• Since ARC is a load-store machine, the code must first fetch the x
and y operands from memory using ld instructions, and then
perform the addition, and then store the result back into z using
an st instruction.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
ARC Transfer of Control
4- Chapter 4 - The Instruction Set Architecture
16
Sequence
• This example shows the assembly language format for
ARC branch instructions.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
17
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
18
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
19
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
20
ARC Data
Formats
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
21
ARC Pseudo-Ops
• Pseudo-ops are instructions to the assembler. They are not part of the
ISA, but instruct the assembler to do an operation at assembly time.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
22
Synthetic Instructions
• Many assemblers will accept synthetic instructions that are converted
to actual machine-language instructions during assembly. The figure
below shows some commonly used synthetic instructions.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
23
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
4- Chapter 4 - The Instruction Set Architecture
24
A More
Complex
Example
Program
• An ARC program
sums five
integers.
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
One, Two, Three-Address
4- Chapter 4 - The Instruction Set Architecture
25
Machines
• Consider how the C expression A = B*C + D might be evaluated
by each of the one, two, and three-address instruction types.
mult B, C, A
add D, A, A
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
One, Two, Three-Address
4- Chapter 4 - The Instruction Set Architecture
26
Machines
• Two Address Instructions: In a two-address instruction,
one of the operands is overwritten by the result. Here,
the code for the expression A = B*C + D is:
load B, A
mult C, A
add D, A
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring
One, Two, Three-Address
4- Chapter 4 - The Instruction Set Architecture
27
Machines
• One Address (Accumulator) Instructions: A one-address
instruction employs a single arithmetic register in the CPU,
known as the accumulator. The code for the expression A =
B*C + D is now:
load B
mult C
add D
store A
Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V.
Heuring