Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is based on the EASY68K simulated processor. Assume the contents of all data and address registers are equal to zero before the start

This question is based on the EASY68K simulated processor. Assume the contents of all data and address registers are equal to zero before the start of the program. All numbers are in hexadecimal.

Demonstrate how instructions of the program are executed by using the E114 Processor Instruction Set of the EASY68K simulator.

Figure Q3 shows a program segment based on the courses simulated processor. The program is to determine the average of a series of integers stored in an array. Assume the average is an integer, ignoring the fractional parts. image text in transcribedimage text in transcribedimage text in transcribed

Question 3 (25 marks) This question is based on the EASY68K simulated processor. Assume the contents of all data and address registers are equal to zero before the start of the program. All numbers are in hexadecimal. Demonstrate how instructions of the program are executed by using the E114 Processor Instruction Set of the EASY68K simulator. Figure Q3 shows a program segment based on the course's simulated processor. The program is to determine the average of a series of integers stored in an array. Assume the average is an integer, ignoring the fractional parts. Figure Q3 Note: Instruction Logical Shift Right (LSR) shifts the contents of register D1 by 3 bits to the RIGHT. ORG START MOVE MOVE.B MOVE.L LOOP ADD.B SUB.B BNE LSR MOVE.B STOP $1000 #$2000, AO #$08, DO #$O, DI (A0)+, DI #$01, DO LOOP #$03, D1 DI, $2050 #$2700 ; Logical Shift Right by 3 places (a) Identify the addressing mode used in each of the following instructions. 1. (i) MOVE.B #$08, DO 2. (ii) ADD.B (A0)+, D1 3. (iii) LSR #$03, D1 4. MOVE.B D1, $2050 (b) The program includes a loop. Which register is being used as a loop counter and how many times in total will the set of instructions within the loop be executed? (c) From which instruction(s) do you deduce the answers for Q3(b)? (2 marks) (2 marks) 4. (d) The loop picks up successive data items from a block of locations in data memory. What are the lowest and highest addresses (in Hex) of the locations in this block? (2 marks) 5. (e) Explain the purpose of the instruction LSR #$03, D1 in relation to the function of the program. (2 marks) (4 marks) (f) Rewrite the program in Figure Q3 to include a subroutine to add a series of integers. The subroutine should perform the functions of the loop. The subroutine occupies memory space just below the main program. Use SUM as the subroutine address label. Initialise and use test data: 1, 2, 3, ... up to the loop counter deduced in Q3(b). Assume the contents of all data registers are set to zero before the start of the program. (Reminder: All numbers including the test data are in hexadecimal.) Test your program with the course's simulator. Once it is working correctly, copy and paste the source code of your program to your MS WORD answer document. (11 marks) Submit a screen shot of the memory contents that include addresses from 1FF0 to 2060 when the program stops. Use the instructions given below to obtain the screen shot. Instructions: 1. To view the memory contents at the simulator screen, click on the View menu and select Memory. Click on the Page down button to the required addresses. Verify that the memory contents are indeed correct. 2. To capture the screen shot' select the window, press + on your computer keyboard, and then paste it onto your word document, (2 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

4 The rebuttals to common arguments for protectionism.

Answered: 1 week ago