12-10-2014, 05:19 PM
heck these handout examples and try to solve Question No.1
jpl (op-code= 16) In this instruction, the value contained in the register specified page 94
in the field ra is checked, and if it is positive, the jump is taken.
jpl r3, [label] (R[3]≥0): PC ← PC+ (label-PC);
mul r5, r7, r1 page-97
The RTL notation for this instruction will be
R[0] © R[5] ← R[7]*R[1]
4. div (op-code= 5) page-97
This instruction will divide the value of the register that is the second operand, by the
number in the register specified by the third operand, and assign the result to the
destination register.
div r4, r7, r2 R[4]←R[0] ©R[7]/R[2],R[0]←R[0] ©R[7]%R[2]
load (op-code= 29)
This instruction is to load a register from the memory. For instance, the
instruction
load r1, [r4 +15]
will add the constant 15 to the value stored in theregister r4, access the memory
location that corresponds to the number thus resulting, and assign the memory
contents of this location to the register r1; this is denoted in RTL by:
R[1] ← M[R[4]+15]
jpl (op-code= 16) In this instruction, the value contained in the register specified page 94
in the field ra is checked, and if it is positive, the jump is taken.
jpl r3, [label] (R[3]≥0): PC ← PC+ (label-PC);
mul r5, r7, r1 page-97
The RTL notation for this instruction will be
R[0] © R[5] ← R[7]*R[1]
4. div (op-code= 5) page-97
This instruction will divide the value of the register that is the second operand, by the
number in the register specified by the third operand, and assign the result to the
destination register.
div r4, r7, r2 R[4]←R[0] ©R[7]/R[2],R[0]←R[0] ©R[7]%R[2]
load (op-code= 29)
This instruction is to load a register from the memory. For instance, the
instruction
load r1, [r4 +15]
will add the constant 15 to the value stored in theregister r4, access the memory
location that corresponds to the number thus resulting, and assign the memory
contents of this location to the register r1; this is denoted in RTL by:
R[1] ← M[R[4]+15]
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
