35 views

Consider an instruction for a hypothetical machine which supports all types of addressing modes, as shown below, with a blank space which might be filled to complete the instruction:
$ADD\: -\: \#2019$
Assuming the machine always seeks for the smallest possible instruction, which of the following statements about the instruction above is true in order to make it complete:

1. A register-name must be placed to complete the instruction
2. The instruction is complete and adds zero to $2019$ and store it in accumulator.
3. The instruction is complete and conforms zero address mode and the value $2019$ is added to the value at top of the stack and the result is pushed onto the stack.
4. The instruction is complete and conforms one address mode and the value $2019$ is added to the value inside accumulator and the result is stored back in accumulator.
edited | 35 views

For this instruction the smallest possible instruction can be obtained by not adding anything to the instruction. Since Zero addressing mode is not possible as the instruction already has one address in it, we need to use accumulator register which implements one address mode. Thus the instruction is complete and the value 2019 is added to the value inside accumulator and the result is stored back in accumulator.

1
2