Oxford AQA International A-level · Computer Science (9645)

Assembly language programming: Practice Questions

5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Assembly language programming.

10 questions26 marksFree, no account
Question 1
1 mark

Which of the following statements correctly distinguishes between assembly language and machine code?

Question 2
1 mark

Register R1 currently holds the value 15 and register R2 holds the value 10. Trace the following instructions:

ADD R1, R1, R2
SUB R1, R1, #3

What is the final value stored in R1?

Question 3
1 mark

Trace the following assembly code snippet to determine the final value in register R1:

MOV R1, #0
MOV R2, #3
loop:
ADD R1, R1, R2
SUB R2, R2, #1
CMP R2, #0
BNE loop

Question 4
1 mark

In the context of a processor's instruction set, which part of an assembly language instruction specifies the actual operation to be performed by the CPU?

Question 5
1 mark

Which logical bitwise instruction and mask should be used to ensure that the least significant bit (bit 0) of an 8-bit value in register R1 is set to 0, while all other bits remain unchanged?

Question 6
2 marks

Define the term immediate addressing as it is used within an assembly language instruction format.

Write your answer out first, then check it against the worked solution.

Question 7
4 marks

Contrast direct addressing and indirect addressing by explaining how the processor identifies the data to be operated on in each mode.

Write your answer out first, then check it against the worked solution.

Question 8
5 marks

A programmer uses a logical shift left operation by 3 places on an 8-bit register containing the value \( 00000101_2 \).
State the resulting bit pattern and explain the mathematical effect this has on the original denary value.

Write your answer out first, then check it against the worked solution.

Question 9
4 marks

Assembly language is a low-level programming language that uses mnemonics to represent machine code instructions specific to a processor.

(a) Define the term instruction set.
(b) Describe the difference between immediate addressing and direct addressing.
(c) Identify the opcode and the operand in the following assembly instruction:
LDR \(R1\), 100

Write your answer out first, then check it against the worked solution.

Question 10
6 marks

A programmer is required to convert a high-level selection structure into assembly language for the OxfordAQA processor.

(a) Write the equivalent assembly language code for the following pseudocode:
IF (\(R1\) > \(R2\)) THEN
    \(R1\) = \(R1\) - \(R2\)
ENDIF


(b) Explain how indirect addressing is used in an instruction such as LDR \(R1\), [\(R2\)].
(c) Describe how the Status Register (SR) is involved in the execution of the CMP and conditional branch instructions used in your answer to part (a).

Write your answer out first, then check it against the worked solution.

* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.

You've seen the model answer. Now get yours marked.

This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.

Want more questions like these? Get a fresh set on this topic, marked as you go.

Practise More