CSSE 232 Computer Architecture I
I/O and Addressing
1 / 21
CSSE 232 Computer Architecture I I/O and Addressing 1 / 21 Class - - PowerPoint PPT Presentation
CSSE 232 Computer Architecture I I/O and Addressing 1 / 21 Class Status Reading for today 2.9-2.10, 6.6 (optional) 2 / 21 Outline I/O More memory instructions Addressing modes Jump and branch instructions 3 / 21 Input
1 / 21
Reading for today
2 / 21
3 / 21
4 / 21
5 / 21
6 / 21
memory
7 / 21
8 / 21
9 / 21
target (26)
10 / 21
Related instructions
11 / 21
1 Sign extend instruction constant 2 Shift left 2 times (multiply by 4) 3 Sum result with PC (actually PC+4)
rs rt Address Word Memory + PC
12 / 21
13 / 21
rs rt . . . funct rd Register Registers
14 / 21
1 Take 26 bits from instruction constant 2 Shift left 2 times (multiply by 4) 3 Concat top 4 bits of the PC as MSBs
Word Memory PC Address
15 / 21
Immediate
rs rt
16 / 21
1 Sign extend instruction constant 2 Add to register value
rs rt Address Word Memory + Register Halfword Byte
17 / 21
What would be the machine language equivalent (in decimal) of the following code? Assume the Loop code starts on location 80000 in memory.
Loop : s l l $t1 , $s3 , 2 add $t1 , $t1 , $s6 lw $t0 , 0( $t1 ) bne $t0 , $s5 , Exit addi $s3 , $s3 , 1 j Loop Exit :
18 / 21
addr instruction format 80000 19 9 2 80004 9 22 9 32 80008 35 9 8 80012 5 8 21 2 80016 8 19 19 1 80020 2 20000
19 / 21
branch to 221 instructions before or after the branch?
branch to 230 instructions before or after the branch?
20 / 21
branch to 221 instructions before or after the branch?
branch to 230 instructions before or after the branch?
20 / 21
21 / 21