A-level Computer Science revision · Processors, software and development

Little Man Computer and addressing modes

The idea

The Little Man Computer is a simple model of a CPU with instructions such as INP, OUT, LDA, STA, ADD, SUB, BRA, BRZ, BRP and HLT. Addressing modes describe how an operand is found: immediate (the operand is the value), direct (it is an address), indirect (it is an address of an address) and indexed (base address plus index register).

  1. Trace LMC programs with a table of accumulator and memory.
  2. BRZ branches if accumulator = 0; BRP if ≥ 0.
  3. Identify the addressing mode.

Watch out In direct addressing the operand is an address; in immediate addressing it is the actual value.

See it worked

Worked example

An LMC program does INP, STA 90, INP, ADD 90, OUT with inputs 4 and 7. What is output?

  1. 4 is stored at 90.
  2. 7 is input; 7 + 4 = 11.
  3. 11 is output.

Answer 11

Your turn

Question 12 marks

Memory 50 holds 12 and the accumulator holds 30. After SUB 50, what is in the accumulator?

Question 21 mark

Which LMC instruction branches only if the accumulator is zero?

Choose one
Question 31 mark

In indexed addressing, the address used is:

Choose one

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms