Question: This question is based on the EASY68Ksimulated processor. Assume the contents of all data and address registersare equal to zero before the start of the
This question is based on the EASY68Ksimulated processor. Assume the contents of all data and address registersare equal to zero before the start of the program. All numbers are in hexadecimal.Demonstratehow 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.

Figure Q3
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, D0(ii)ADD.B(A0)+, D1 (iii)LSR#$03, D1(iv)MOVE.BD1, $2050(4 marks)
(b)The program includes a loop. Which register is being used as a loopcounter and how many times in total will the set of instructions within the loopbe executed?(2 marks)
(c)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)(e)Explain the purpose of the instruction LSR #$03, D1 in relation to the function of the program.(2 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 SUMas 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 courses simulator. Once it is working correctly, copy and pastethe source code of your program to your MS WORD answer document. (11 marks)
(g)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 Viewmenu and select Memory. Click on the Pagedown button to the required addresses. Verify thatthe memory contents are indeed correct.2.To capture the screen shot select the window, press
ORG START MOVE MOVE.B MOVE.L LOOP ADD.B SUB.B BNE LSR MOVE.B STOP $1000 #$2000, AO #$08, DO #$0, DI (A0)+, DI #501, DO LOOP #$03, D1 D1, $2050 #$2700 ; Logical Shift Right by 3 places ORG START MOVE MOVE.B MOVE.L LOOP ADD.B SUB.B BNE LSR MOVE.B STOP $1000 #$2000, AO #$08, DO #$0, DI (A0)+, DI #501, DO LOOP #$03, D1 D1, $2050 #$2700 ; Logical Shift Right by 3 places
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
