The table shows assembly language instructions for a processor that has one general purpose register, the Accumulator (ACC). Instruction Table: Label | Opcode | Operand | Explanation ---|---|---|--- | LDM | #n | Load the number n to ACC | LDD | <address> | Load the contents of the given address to ACC | LDI | <address> | The address to be used is at the given address Load the contents of this second address to ACC | ADD | <address> | Add the contents of the given address to the ACC | STO | <address> | Store the contents of the ACC at the given address <label>: | <data> | Gives a symbolic address <label> to the memory location with the contents <data>. <label> can be used in place of <address> # denotes a denary number, e.g. #123
- (a)The address 500 contains the value 100 and the address 100 contains the value 20. State the addressing mode and the contents of ACC after each instruction has been executed. LDM #500 Addressing mode Contents of ACC LDD 500 Addressing mode Contents of ACC LDI 500 Addressing mode Contents of ACC[3]
- (b)Use only the given instruction set to write assembly language code to: • use the constant 20 which needs to be stored • add this constant to the value stored in the address contained in the variable Y • store the result in variable Z. Instruction Table (to be completed): Label | Opcode | Operand ---|---|---[7]
Mark scheme
Marking points from the official mark scheme (May/June 2022). The mark or mark type is shown in brackets.
- [3] 9(a) LDM #500: Immediate 500 LDD 500: Direct 100 LDI 500: Indirect 20
- [7] 9(b) One mark for LDM #2320 seen One mark for storing 20 at any address One mark for labelling that address e.g. Twenty away from the program code One mark for labelling addresses away from the program code as Y and Z One mark for correct use of LDI Y One mark for correct use of STO Z One mark for correct use of ADD with labelled address Example Code: Label | Opcode | Operand --- | --- | --- | LDM | #20 | STO | Twenty | LDI | Y | ADD | Twenty | STO | Z Twenty: | #20 Y: Z:
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →