Professional Documents
Culture Documents
00pm)
1. Write an Assembly language programming for the following expressions using IAS computer
Instruction set and interpret to the flow of IAS computer
1. A=(B-C)*D
2. A=B*(C+D)
3. A=(B-C)/D
4. A=B/(C+D)
5. A=-(B+C-D)
6. A=(B*2)/2
Direct
Indirect
Relative
Indexed
4. An instruction is stored at location 300 with its address field at location 301. The address field has
the value 400. A processor register R1 contains the number 200. Evaluate the effective address if the
addressing mode of the instruction is (a) direct; (b) immediate (c) relative (d) register indirect; (e)
index with R1 as the index register.
5. Assume that in a certain byte-addressed machine all instructions are 32 bits long. Assume the
following state of affairs for the machine: Fill in the following table:
6. Consider two different machines with two different instruction set both which have a clock
rate of 200MHZ. The following measurements are recorded on the two machines running a
given set of bench mark programs.
Instruction Instruction Cycles per
Type count Instruction
Machine A
ALU 8 1
Load &
4 3
Store
Branch 2 4
Others 4 3
Machine B
ALU 10 1
Load &
8 2
Store
Branch 2 4
Others 4 3
a. Determine the effective CPI, MIPS rate and execution time for each machine.
b. Comment on result.
7. Write a IAS machine structure for the following:
main () {
int a=15, b=5, c;
if (a >= b)
c = a – b;
else
c = a + b;
}
8. Consider two different machines, with two different instruction sets, both of which have a clock
rate of 40 MHz processor.
(a) Determine the effective CPI, MIPS rate, and execution time for this program.
(b) Comment on the results.
10. The two-word instruction at address 300 and 301 is load to Accumulator with address field equal
to 400. Program Counter has the value 300 for fetching the instruction. The content of processor
register is 500 and the content of index register is 202. The memory content at each of these
addresses as shown in Table.
Compute the effective address and operand for the following addressing modes:
Direct address, Indirect address, Index address, Relative address, Autoincrement and
Autodecrement.