The Program Counter
addi $1, $0, 43
addi $2, $0, 2
addi $3, $0, 0
PC
0x10000
0x10004
0x10008
0x1000c
bne $1, $2, 4
x = 43; // addi $1, $0, 43
y = 2; // addi $2, $0, 2
if (x == y)
same = 1; // addi $3, $0, $1 execute if x == y
0x10000
0x10004
0x10008
0x1000c
0x10010
Understand branches
addi $3, $0, 1
0x10010
Previous slide
Next slide
Back to first slide
View graphic version