December
1999 QUESTION 3 Total Marks: 15 Marks |
Click here to access other
questions
SUGGESTED SOLUTIONS |
(a) |
Explain the difference between direct and indirect addressing. In direct addressing,instructions contain the effective address of the data; in indirect addressing,instructions point to memory locations containing the effective address of the data.(1)
|
[1] |
(b) |
The diagrams below show register and memorycontents. For each instruction,identifythe addressing mode used and the value that is loaded into the accumulator: (i)LOAD [R3 ] 9000 register addressing (1) (ii)LOAD @[R1 ] FACE register indirect (1) (iii)LOAD @[1FFE ] FACE indirect addressing (1) (iv)LOAD [1FFF ] 9000 direct addressing (1)
|
[4] |
(c) |
In the design of an instruction set,it maynot be possible to store all operands in the instruction.What are the two trade-offs which must be made? Address range versus addressing flexibility (1). Number of memory references versus complexity of the addresscalculation (1).
|
[2] |
(d) |
Briefly explain these two displacement addressing methods,with the aid of a diagram: (i)base addressing [3 marks ] The special register is a base register.The contents of the base provide the starting address of a segment of the current program (1);the offset field provides the displacement from this segment (1). (1)for a reasonable diagram;allow marks for other reasonable points. (ii)indexed addressing.[3 marks ] The offset field provides the starting address of a data structure such as an array; the content of the indexregister provides the displacement (1). Using this arrangement, the displacement can be incremented or decremented efficiently from the register, allowing the next element to be accessed (1). (1)for a reasonable diagram; allow marks for other reasonable points.
|
[6] |
(e) |
List one advantage and one disadvantage of stack/implied addressing. advantage: no memory reference needed (1); disadvantage:limited applicability (1). Allow credit for other reasonable answers. |
[2] |