Download presentation
Presentation is loading. Please wait.
2
CPU has 6 special locations called registers
4 – bit status register NZVC 16 – bit accumulator (A) 16 – bit index register (X) 16 – bit program counter (PC) 16 – bit stack pointer (SP) 24 – bit instruction register (IR)
3
Data and Control Input Device Main Memory Output Device
Central Processing Unit Main Memory Output Device Bus
4
0002 0000 0001 0003 0004 0005 Main Memory
5
Memory address and content
0000 1 0003 0004 0007 000A
6
Pep Input Pep input comes from either a file or the keyboard, not both at the same time Must specify input source before executing a program For a GUI simulator, input comes from a field
7
Pep output Pep output goes to either a file or the screen, not both at the same time Must specify output source before executing a program. Need to give file name when output goes to a file For a GUI simulator, output goes to a new window that can be saved into a file
8
Data and Control Input Device Main Memory Output Device
Central Processing Unit Main Memory Output Device Bus
9
Instruction format Unique, wired into the CPU
Instructions are different for different computers The Pep/8 has 39 instructions (Fig 4.6) on your textbook Each instruction contains an instruction specifier (or opcode). Some instruction have operand specifier following instruction specifier. Unary instructions are one byte long and do not have operand specifier
10
nonuniary instruction
Instruction specifier Operand specifier uniary instruction Instruction specifier Instructions
11
Addressing modes Addressing mode aaa Immediate 000 Direct 001 Indirect
010 Stack relative 011 Stack relative deferred 100 Indexed 101 Stack-indexed 110 Stack-indexed deferred 111 The addressing aaa field
12
Prep/8 Instruction identifier fields
Addressing mode a immediate ìndexed 1 The addressing-a field Register r Accumulator, A Index register, X 1 The register-r field
13
Examples of nonunary & unary instructions
01A A A5 01A6 Opcode r a a a Operand specifier The above two instructions in binary form are called machine language The instructions in hexadecimal preceded by their memory addresses 01A3 8D034E 01A6 1E
14
Direct Addressing Mode
aaa = 001 indicates direct addressing Operand specifier is the address of the operand Operand = Mem [Operand Specifier]
15
Example instructions The stop instruction has instruction specifier The load instruction has instruction specifier 1100 raaa. It load a word (two bytes) into the (A) or (X) depending on r. The status bits N & Z are affectedز R <- operand; N <- r<0; Z <- r = 0
16
Example 4.4 Executed the instruction C1004A
17
Computer Architecture
Week Number 12 Chapter 4: Direct Addressing Slides by Eltayeb Abuelyaman The University of Nizwa
18
Pep/8 Addressing
19
Pep/8 Instructions
21
Stop and Load Instructions
The stop instruction has instruction specifier The load instruction has instruction specifier 1100 raaa. It loads a word (two bytes) into the (A) or (X) depending on r. The status bits N & Z are affected r ← Oprnd; N ← r <0; Z ← r=0
22
Example 4.4 Executed the instruction C1004A Solution C 1 0 0 4 A
Opcode raaa Operand specifier
23
Load Instruction
24
The Store instruction
25
Store register r to memory
26
The Add instruction
27
Add Instruction…. continue
28
The And instruction
29
The And instruction…continue
30
The Invert instruction
31
Load & Store Instructions
32
Load-Byte Register r from Memory
33
Character input Instruction
34
Character Input instruction…continue
35
Character output cont..
36
Example Output Instruction
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.