11(a)Assembly Language Addressing ModesHard5 marks
The table shows assembly language instructions for a processor that has one register, the Accumulator (ACC).
| Opcode | Operand | Explanation |
|---|---|---|
| LDM | #n | Load the number n to ACC |
| LDD | Load the contents of the location at the given address to ACC | |
| LDI | The address to be used is at the given address. Load the contents of this second address to ACC | |
| ADD | Add the contents of the given address to the ACC | |
| ADD | #n | Add the number n to the ACC |
| SUB | Subtract the contents of the given address from the ACC | |
| SUB | #n | Subtract the number n from the ACC |
| STO | Store the contents of ACC at the given address | |
| Gives a symbolic address |
# denotes a denary number, e.g. #123.
The current contents of memory are:
| address | data |
|---|---|
| 232 | 120 |
| 580 | 26 |
Use only the given instruction set to write assembly language code to:
- store the denary value 325 in labelled variable A
- store the value from location 232 in labelled variable B
- subtract the value 50 from the value stored in variable B
- store the current value in the accumulator in location 875
- add the value stored in location 580 to the value stored in variable A
- subtract the value stored in location 875 from the current value in the accumulator
- store the result in variable Final.
Answer
0 words