BREAKING
Student's code works, nobody knows why, including student★Local teen writes pseudocode, accidentally invents a language★Binary joke told in class, exactly 10 students laugh★
  1. Home
  2. A Level
  3. Computer Science
  4. OCR
  5. Assembly language programming (Little Man Computer)

OCR A Level Computer Science

Topic questions Programming languages and Integrated Development Environments Assembly language programming (Little Man Computer)

Assembly language programming (Little Man Computer)

8 questions · 158 marks · about 3 hours

Assembly language programming (Little Man Computer) questions

TopicAssembly language programming (Little Man Computer)

OCR H446 Assembly language programming (Little Man Computer) 8 questions

Computer systems June 2025, Question 4 19 marks

Also involves High-level and low-level languages

Kofi is a software engineer and has been asked to write some code using the Little Man Computer (LMC) instruction set.

(a)

State the LMC command that would be used for each description given in the table.

Figure for question 4
[3]
Reveal mark scheme Mark scheme for question 4(a)
(b)

Kofi has been asked to write a program that inputs two numbers and then outputs the largest of the two numbers.

Write the code for this program using the LMC instruction set.

You can assume that the two numbers will always be different.

[4]
Reveal mark scheme Mark scheme for question 4(b)
(c)

* Kofi is working on a number of projects. These include:

• project 1 – Writing a mobile phone app to look at the news

• project 2 – Writing software to send temperature readings from an embedded heat sensor to other devices

• project 3 – Writing an image editing application for a desktop computer

• project 4 – Writing software to calculate the results of a physics experiment that produces terabytes of data

• project 5 – Writing a new device driver for a new piece of hardware.

Discuss which of these projects should be written in a high level programming language and which should be written in a low level language.

You should include the following in your answer:

• what is meant by high level programming language and low level language

• which projects are suitable for high level and which are suitable for low level languages

• a conclusion that justifies why these different languages are needed.

[12]
Reveal mark scheme Mark scheme for question 4(c)

Computer systems June 2024, Question 1 23 marks

The stored program concept uses the Fetch-Decode-Execute cycle to get the next instruction from memory and then execute it.

(a)

Describe what happens during the fetch stage of the Fetch-Decode-Execute cycle.

You should state the different registers and buses that are used in your answer.

[4]
Reveal mark scheme Mark scheme for question 1(a)
(b)

One of the instructions that may be fetched and executed as part of this cycle is a branch instruction.

State the name of the register that would be altered in the execute phase during a branch instruction.

[1]
Reveal mark scheme Mark scheme for question 1(b)
(c)

Three ways of improving the performance of a CPU are increasing the clock speed, adding more cores and using pipelining.

Explain how pipelining improves the performance of a CPU.

[3]
Reveal mark scheme Mark scheme for question 1(c)
(d)

The Fibonacci sequence is a series of numbers. It starts with the number 0 and then 1. Each number after that is a sum of the two numbers before it.

The first seven numbers in the series are: 0 1 1 (i.e. 1 + 0) 2 (i.e. 1 + 1) 3 (i.e. 1 + 2) 5 (i.e. 2 + 3) 8 (i.e. 3 + 5)

Orla has written some code to show the first five numbers in the Fibonacci sequence (0,1,1,2,3) using the Little Man Computer (LMC) instruction set.

The LMC code that Orla has written contains an error.

Figure for question 1
(d)(i)

State the five outputs that Orla’s code would give.

[3]
Reveal mark scheme Mark scheme for question 1(d)(i)
(d)(ii)
Figure for question 1
[4]
Reveal mark scheme Mark scheme for question 1(d)(ii)
(e)

In Orla’s LMC code, she used direct memory addressing.

Give three other modes of memory addressing.

[3]
Reveal mark scheme Mark scheme for question 1(e)
(f)

Since the development of high level languages, the use of assembly languages has reduced.

Give two reasons why in some circumstances programmers will choose to write code in assembly language.

[2]
Reveal mark scheme Mark scheme for question 1(f)
(g)

The performance of a computer system can be improved by adding more RAM.

Explain why adding more RAM will improve the performance of a computer system.

[3]
Reveal mark scheme Mark scheme for question 1(g)

Computer systems June 2022, Question 1 36 marks

A charity uses a desktop computer to record financial donations that it receives. The computer contains a single core, 2.4GHz processor with 2MB cache.

(a)

The processor uses the Von Neumann architecture.

(a)(i)

Describe what is meant by the term ‘Von Neumann architecture’.

[2]
Reveal mark scheme Mark scheme for question 1(a)(i)
(a)(ii)

Give one way that the Harvard architecture differs from the Von Neumann architecture.

[1]
Reveal mark scheme Mark scheme for question 1(a)(ii)
(b)

The charity is concerned that the performance of the computer is not sufficient and wishes to replace the processor.

Give two features of a replacement processor that would increase the typical performance of the computer.

[2]
Reveal mark scheme Mark scheme for question 1(b)
(c)

Fig. 1 shows assembly code written using the Little Man Computer (LMC). The program calculates and outputs the total amount that is donated to the charity in any particular day. Depending on the amount, an additional bonus may be added to each amount donated.

Figure for question 1
(c)(i)

The program shown in Fig. 1 is run once using three different inputs. Therefore, while the program is running once, it will output the updated total three times.

Give the total values that are output when the values 10, 50 and 120 are input into this program.

[3]
Reveal mark scheme Mark scheme for question 1(c)(i)
(c)(ii)

Write LMC code that will reset the value of the memory location labelled total to zero and then stop the program.

[4]
Reveal mark scheme Mark scheme for question 1(c)(ii)
(c)(iii)

This program is run on a processor that allows pipelining.

Define the term ‘pipelining’.

[3]
Reveal mark scheme Mark scheme for question 1(c)(iii)
(c)(iv)

Explain one benefit to the charity of using a processor that allows pipelining.

[2]
Reveal mark scheme Mark scheme for question 1(c)(iv)
(d)

The processor contains registers including the accumulator and the program counter. The contents of these registers are modified during the Fetch-Decode-Execute cycle.

(d)(i)

Describe how the accumulator is used during the Fetch-Decode-Execute cycle.

[2]
Reveal mark scheme Mark scheme for question 1(d)(i)
(d)(ii)

Describe how the program counter is used during the Fetch-Decode-Execute cycle.

[2]
Reveal mark scheme Mark scheme for question 1(d)(ii)
(d)(iii)

State the name of three other registers that are used during the Fetch-Decode-Execute cycle.

[3]
Reveal mark scheme Mark scheme for question 1(d)(iii)
(e)

* The charity has several desktop computers in their office that use a CISC processor. They are considering buying mobile devices for their staff to use when they are not in the office.

Discuss whether these mobile devices should use the same CISC processors that are used in their desktop computers or if they should use a RISC processor instead.

You should include the following in your answer:

• the difference between each processor type

• the suitability of each processor type for mobile devices.

[12]
Reveal mark scheme Mark scheme for question 1(e)

Computer systems November 2021, Question 6 24 marks

A program written using the Little Man Computer instruction set is shown in Fig. 1.

Figure for question 6
(a)

Various registers are used when the program above is executed.

(a)(i)

State what is meant by the term ‘register’.

[2]
Reveal mark scheme Mark scheme for question 6(a)(i)
(a)(ii)

Explain how the accumulator is used when the line BRP pos is executed.

[2]
Reveal mark scheme Mark scheme for question 6(a)(ii)
(b)

Complete the table below to show the output(s) from this program given the inputs.

Figure for question 6
[4]
Reveal mark scheme Mark scheme for question 6(b)
(c)

Write an algorithm using pseudocode that has the same functionality as the code in Fig. 1

[4]
Reveal mark scheme Mark scheme for question 6(c)
(d)

* In assembly language, different modes of addressing memory can be used.

Discuss the different modes used. You should include:

• How the operand value is determined

• What an operand of 27 would refer to in that mode

• The reasons for requiring multiple modes of addressing

[12]
Reveal mark scheme Mark scheme for question 6(d)

Computer systems November 2020, Question 7 11 marks

The table below shows the Little Man Computer instruction set.

MnemonicInstruction
ADDAdd
SUBSubtract
STA
LDALoad
Branch always
BRZ
BRP
INPInput
OUTOutput
End program
(a)

Complete the table above to show the missing mnemonics and instructions.

[5]
Reveal mark scheme Mark scheme for question 7(a)
(b)

Write a program using the Little Man Computer instruction set that will allow a user to input two numbers and then output the larger of the two numbers. The program should loop continuously.

[6]
Reveal mark scheme Mark scheme for question 7(b)

Computer systems June 2019, Question 3 9 marks

A program written in the Little Man Computer instruction set is given below.

Figure for question 3
(a)

State what the program outputs are for the following inputs.

Figure for question 3
[3]
Reveal mark scheme Mark scheme for question 3(a)
(b)

State what the purpose of the program is.

[1]
Reveal mark scheme Mark scheme for question 3(b)
(c)

Explain which registers are used and their values when the line STA count is executed and the accumulator is holding the value 9. The label count refers to memory location 16.

[2]
Reveal mark scheme Mark scheme for question 3(c)
(d)

Whilst the line STA count is being executed, the CPU receives a signal from another process, requiring its attention.

State the name for the signal received by the CPU.

[1]
Reveal mark scheme Mark scheme for question 3(d)
(e)

The code uses direct addressing. Describe one other mode of addressing.

[2]
Reveal mark scheme Mark scheme for question 3(e)

Computer systems June 2018, Question 1 24 marks

A digital coffee making machine has a CPU that uses the Little Man Computer Instruction Set.

(a)

Little Man Computer operates on a computer system based on the Von Neumann Architecture.

(a)(i)

State two features of the Von Neumann architecture.

Question 1, shown as an image

2

[2]
Reveal mark scheme Mark scheme for question 1(a)(i)
(a)(ii)

Describe one feature, not part of the standard Von Neumann Architecture, which contemporary CPUs may have in order to improve performance.

Figure for question 1
[2]
Reveal mark scheme Mark scheme for question 1(a)(ii)
(b)

Part of the coffee making machine’s code asks the user to press a button to select strength. The code outputs 1 which will switch on a green light to indicate a valid selection or outputs 0 to indicate an invalid selection.

The code is shown below:

Figure for question 1
(b)(i)

Tick the appropriate boxes below to indicate which inputs will result in a green light (i.e. code outputs 1) and which with a red light.

Figure for question 1
[2]
Reveal mark scheme Mark scheme for question 1(b)(i)
(b)(ii)

Explain which registers and buses are used, and the values they store/carry, when the line LDA redLight is executed (after it has been fetched and decoded). You should assume the address redLight refers to memory location 11.

Figure for question 1
[6]
Reveal mark scheme Mark scheme for question 1(b)(ii)
(b)(iii)

Write code in a high‑level language or pseudocode that has the same functionality as the code in Fig. 1.

Figure for question 1
[3]
Reveal mark scheme Mark scheme for question 1(b)(iii)
(b)(iv)

* Discuss the differences between assembly code and high‑level languages. You should refer to:

• the advantages and disadvantages of writing programs in assembly code rather than a high-level language

• when each approach might be used

• why the coffee machine was programmed in assembly code.

Figure for question 1
[9]
Reveal mark scheme Mark scheme for question 1(b)(iv)

Computer systems June 2017, Question 5 12 marks

(a)

Below is part of a program written using the Little Man Computer instruction set. This section of code can exit by either jumping to the code labelled pass or fail depending on what value is in the accumulator when the code is run.

Figure for question 5
(a)(i)

Explain what the line ten DAT 10 does.

[3]
Reveal mark scheme Mark scheme for question 5(a)(i)
(a)(ii)

Complete the table below determining whether the program branches to pass or fail given the following values in the Accumulator when it is run.

Figure for question 5
[3]
Reveal mark scheme Mark scheme for question 5(a)(ii)
(b)

The complete program is shown below:

Figure for question 5
(b)(i)

Give one instruction in the program that when executed, changes the value in the Accumulator.

[1]
Reveal mark scheme Mark scheme for question 5(b)(i)
(b)(ii)

Give one instruction in the program that when executed, changes the value in the Program Counter.

[1]
Reveal mark scheme Mark scheme for question 5(b)(ii)
(b)(iii)

State the value the code outputs for the input 18.

[1]
Reveal mark scheme Mark scheme for question 5(b)(iii)
(b)(iv)

State the value the code outputs for the input 37.

[1]
Reveal mark scheme Mark scheme for question 5(b)(iv)
(b)(v)

Describe the purpose of the program.

[2]
Reveal mark scheme Mark scheme for question 5(b)(v)

Report a problem with a question on this page
What is wrong?

Goes to whoever maintains the question split. No account needed and nothing is published on this page.

Memes

Certified Computer Science memes. Peer-reviewed by nobody.

Laugh now. Cry in the exam hall later. Then come back and do a past paper.

Write a proper algorithm
Write ‘sort it’ and leave
Me on the 6-mark pseudocode question
Debugging with print statements
Using a trace table
Knowing the difference between = and ==
Explaining recursion by explaining recursion
Code enlightenment, ranked

Mum 💖

can you fix the wifi since you do computers 🥰

that's not what computer science is

so that's a no then

📱 Screen time this week · Discord8h 2m

Turned it off and on again

Computer Science starter pack

Laptop with 47 tabs openPython error on line 1Counting binary on fingersThis website
Compiled with zero errors