Question 14

AQA Computer Science June 2023 Paper 1 (7516/1)AS5 marks

On the specification

14.1
3.1 Fundamentals of programming3.7 Fundamentals of computer organisation and architecture
14.2
3.3 Systematic approach to problem solving
Question text

14 This question adds a memory address check to the Skeleton Program. Each time a JSR opcode is executed the return address is stored in memory. The memory location used for this could already contain an instruction or data. If storing a return address will overwrite an instruction or data, then an appropriate error message should be output using the ReportRunTimeError subroutine. The original code in the ExecuteJSR subroutine should only be carried out if there is no error. What you need to do: Task 1 Amend the ExecuteJSR subroutine. If storing a return address would overwrite an instruction or data, the ReportRunTimeError subroutine should be called with an appropriate error message. One method of completing this task would require the addition of extra parameter(s) to the ExecuteJSR subroutine. Task 2 If your solution requires additional parameter(s) for the ExecuteJSR subroutine amend the call to ExecuteJSR in the Execute subroutine. Task 3 Test that the changes you have made work by conducting the following test: • run your amended Skeleton Program • enter L • load prog3 • enter A • enter R Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 14.1 Your PROGRAM SOURCE CODE for the entire subroutine ExecuteJSR and the entire subroutine Execute if you have made changes in Task 2. [4 marks] 14.2 SCREEN CAPTURE(S) showing the requested test described in Task 3. The SCREEN CAPTURE(S) only need to show the final frame and the contents of the stack before execution terminates. [1 mark]