3(a)Assembly Language Addressing ModesHard3 marks
The following table shows part of the instruction set for a processor. The processor has two registers: the Accumulator (ACC) and an Index Register (IX).
| opcode | operand | explanation |
|---|---|---|
| LDM | #n | Immediate addressing. Load the number n to ACC |
| LDD | Direct addressing. Load the contents of the location at the given address to ACC | |
| INC | Add 1 to the contents of the register (ACC or IX) | |
| STO | Store the contents of ACC at the given address | |
| ADD | #n / Bn / &n | Add the number n to the ACC |
| ADD | Add the contents of the given address to the ACC | |
| DEC | Subtract 1 from the contents of the register (ACC or IX) | |
| END | Return control to the operating system |
can be an absolute or symbolic address. # denotes a denary number, e.g. #123. B denotes a binary number, e.g. B01001010. & denotes a hexadecimal number, e.g. &4A.
The current contents of memory are:
| address | data |
|---|---|
| 100 | 200 |
| 101 | 205 |
| 102 | 100 |
| 103 | 50 |
| … | |
| 200 | 101 |
| 201 | 100 |
| 202 | 20 |
| 203 | 13 |
| 204 | 220 |
| 205 | 30 |
Complete the table to identify the data that will be stored in the accumulator after each set of instructions has been executed.
| accumulator current data | set of instructions | new accumulator data |
|---|---|---|
| B11001010 | ADD B00000010 INC ACC | |
| #100 | LDM #200 ADD 200 | |
| #103 | LDD 103 DEC ACC DEC ACC |