Question bank › A-level Computer Science › Fundamentals of computer organisation and architecture

Instruction sets, addressing modes and assembly language

Answer on paper first, then reveal the mark scheme one mark at a time.

1Standard4 marks

The table shows the contents of memory locations before a program runs. A program is run using the AQA assembly language instruction set.

Address100101102
Contents1490
LDR R0, 100
LDR R1, 101
ADD R2, R0, R1
SUB R2, R2, #5
STR R2, 102
HALT

(a) State the value in R2 after the ADD instruction executes. [1]

(b) State the value in R2 after the SUB instruction and the value stored in location 102 when the program ends. [2]

(c) State the purpose of the HALT instruction. [1]

2Standard5 marks
      MOV R0, #1
      MOV R1, #0
loop: ADD R1, R1, R0
      ADD R0, R0, #1
      CMP R0, #5
      BLT loop
      HALT

(a) State the final values in R0 and R1 when the program halts. [2]

(b) State how many times the instruction ADD R1, R1, R0 is executed. [1]

(c) Describe what the program calculates. [1]

(d) State the change needed so that the program calculates the sum of the integers from 1 to 10. [1]

3Hard5 marks

Memory location 200 contains the binary value 10110111.

LDR R0, 200
AND R1, R0, #15
LSL R2, R1, #2
EOR R3, R2, #255
HALT

(a) Give the denary values in R1, R2 and R3 after the program halts. [3]

(b) State the effect of the instruction LSL R2, R1, #2 in terms of multiplication. [1]

(c) State the effect of EOR R3, R2, #255 on an 8-bit value. [1]

Stuck on Instruction sets, addressing modes and assembly language?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Stretch6 marks

Write an assembly language program, using the AQA instruction set, that:

  • reads a number from memory location 300;
  • stores 1 in memory location 301 if the number is greater than 50;
  • otherwise stores 0 in memory location 301;
  • then stops.

[6]

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session