Question 3
OCR Computer Science Specimen Paper 1AS6 marks
On the specification
- (a)
- 1.2 Software and software development
- (b)(i)
- 1.2 Software and software development
- (b)(ii)
- 1.1 The characteristics of contemporary processors, input, output and storage devices
- (c)(i)
- 1.2 Software and software development
- (c)(ii)
- 2.2 Problem solving and programming
Question text
3 The following assembly code in Fig.1 is written for the Little Man Computer instruction set. INP STA arg1 INP STA arg2 LDA arg1 loop SUB arg2 BRP loop ADD arg2 OUT arg1 DAT arg2 DAT Fig.1 (a) State the output when the inputs are 13 followed by 5. [1] (b) In the line: loop SUB arg2 (i) State what opcode SUB does. [1] (ii) Name the register in which the result of this line is stored. [1] (c) (i) State what the program in Fig.1 does. [1] (ii) Using pseudocode write a program for a procedural language that takes in two inputs and gives the same output as the program in Fig.1. [2]