check this soltion of Cs501 assignmetn number 02
Q#01
Specify the condition for the branch instruction and the status of the PC after the branch instruction executes with a true branch condition.
solution
Instruction | Condition | PC status |
Jump[20] | Always | PC← PC+20 |
Jnz r3,[33] | If R[3] ≠ 0 | PC← PC+33 |
Jz r1,[16] | If R[1] = = 0 | PC← PC+16 |
Jpl r5,[37] | If R[5] ≥0 | PC← PC+37 |
Jmi r7,[40] | If R[7] < 0 | PC← PC+40 |
Q#02
Identify the addressing modes and Register Transfer Language(RTL) description(meaning) for the given Falcon-A instructions
solution
Instruction | Addressing Mode | RTL description(meaning) |
Load r3,[r5+27] | Displacement | R[3] ← M[R[5] +27] |
Jnz r5,[15] | Relative | (If R[5] ≠ 0): PC← PC+15 |
Shiftl r3,r2,5 | Immediate | Shift r3 left 6 times and store in r2 |
Add r6,r5,r7 | Register | R[6] ← R[5] + R[7] |
Subi r4,r3,17 | Immediate | R[4] ← R[3] -17 |
0 comments:
Post a Comment