Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image 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. ORG START MOVE MOVEB MOVET LOOP ADDB SUBB BNE LSR MOVTB STOP S1000 S2000. AO #S08. DO SO DI (40)- DI -50! DO LOOP -S03. DI DIS2050 52700 Logical Shift Right by 3 places Figure 03 Note: Instruction Logical Shift Right (LSR) shifts the contents of register D1 by 3 bits to the RIGHT. (a) Identify the addressing mode used in each of the following instructions. (i) MOVE.B #$08, DO (ii) ADD.B (A0)+, DI (iii) LSR #$03, D1 (iv) MOVE.B D1, $2050 (4 marks) (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? (2 marks) From which instruction(s) do you deduce the answers for Q3(b)? (2 marks) (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) Explain the purpose of the instruction LSR #S03, D1 in relation to the function of the program. (2 marks) 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. ORG START MOVE MOVEB MOVET LOOP ADDB SUBB BNE LSR MOVTB STOP S1000 S2000. AO #S08. DO SO DI (40)- DI -50! DO LOOP -S03. DI DIS2050 52700 Logical Shift Right by 3 places Figure 03 Note: Instruction Logical Shift Right (LSR) shifts the contents of register D1 by 3 bits to the RIGHT. (a) Identify the addressing mode used in each of the following instructions. (i) MOVE.B #$08, DO (ii) ADD.B (A0)+, DI (iii) LSR #$03, D1 (iv) MOVE.B D1, $2050 (4 marks) (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? (2 marks) From which instruction(s) do you deduce the answers for Q3(b)? (2 marks) (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) Explain the purpose of the instruction LSR #S03, D1 in relation to the function of the program. (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_2

Step: 3

blur-text-image_3

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions