You are on page 1of 2

School of Computer Sciences

Universiti Sains Malaysia


CS131 Computer Organisation

Academic Session 2013/2014 Semester 1

Tutorial 6: Addressing Modes and Formats


1. Given the following memory values and a one-address machine with an accumulator, what
values do the following instructions load into the accumulator?
Word 20 contains 40
Word 30 contains 50
Word 40 contains 60
Word 50 contains 70
(a)
(b)
(c)
(d)
(e)
(f)

LOAD IMMEDIATE 20
LOAD DIRECT 20
LOAD INDIRECT 20
LOAD IMMEDIATE 30
LOAD DIRECT 30
LOAD INDIRECT 30

2. Consider a 16-bit processor in which the following appears in main memory, starting at
location 100:
100
101
102

Load to AC
500
Next instruction

Mode

The first part of the first word indicates that this instruction loads a value into an
accumulator. The Mode field specifies an addressing mode and, if appropriate, indicates a
source register; assume that when used, the source register is R1, which has a value of
400. There is also a base register that contains the value 100. The value of 500 in location
101 may be part of the address calculation. Assume that location 399 contains the value
999, location 400 contains the value 1000, and so on. Determine the effective address and
the operand to be loaded for the following address modes:
(a) Direct
(e) Displacement

(b) Immediate
(f) Register

(c) Indirect
(d) PC relative
(g) Register indirect

3. 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 address mode of the instruction is:
(a) Direct
(b) Immediate
(c) Relative
(d) Register indirect (e) Index with R1 as the index register

4.

A PC-relative mode branch instruction is stored in memory at address 62010. The branch
is made to location 53010. The address field in the instruction is 12 bits long.
(a) What is the decimal value in the instruction (relative address field)?
(b) What is the binary value in the instruction?
(c) Determine the binary value of the PC and calculate the binary value of 53010. Then
show that the binary value in PC plus the relative address calculated in part (b) is
equal to the binary value of 53010.

5. What must the address field of an indexed address mode instruction be to make it the same
as a register indirect mode instruction?

You might also like