Exercise 9 Name __________________ Score __/18
![]() |
ADDI t5 <- tfp+1 MOVEM M[tx] <- M[t5] |
![]() |
![]() |
LOAD t3 <- M[tx] ADDI t2 <- t3+1000 ADD t1 <- t2+tfp ADDI t4 <- 0 STORE M[t1] <- t4 |
![]() |

where the JUMP instruction goes to an address contained in a register.
Use these instructions to implement the following tree patterns:
JUMP
JUMP
CJUMP
|
|
/ | | | \
NAME
EQ T F
Assume that a CJUMP is always followed by its false label and the T and F label basic blocks. Show the best way to implement each pattern; in some cases you may need to use more than one instruction or make up a new temporary.
| JUMP goto ri | JUMP | |
| JUMP
ADDI ri <- r0 + NAME JUMP goto ri |
JUMP | NAME |
| BRANCHEQ SUB ri
<- rj - rk if ri == 0 goto T |
CJUMP
/ | | | \ EQ T F |