An LMC program does INP, STA 90, INP, ADD 90, OUT with inputs 4 and 7. What is output?
- 4 is stored at 90.
- 7 is input; 7 + 4 = 11.
- 11 is output.
Answer 11
A-level Computer Science revision · Processors, software and development
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).
Watch out In direct addressing the operand is an address; in immediate addressing it is the actual value.
An LMC program does INP, STA 90, INP, ADD 90, OUT with inputs 4 and 7. What is output?
Answer 11
Memory 50 holds 12 and the accumulator holds 30. After SUB 50, what is in the accumulator?
Which LMC instruction branches only if the accumulator is zero?
In indexed addressing, the address used is:
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.