Ece590_tutorial 7 (uitm)

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ece590_tutorial 7 (uitm) as PDF for free.

More details

  • Words: 413
  • Pages: 2
ECE590 Tut#7 (Microprocessor) 1.

What will D5 contain after each instruction, if D4 and D5 initially contain 0000015A and 00000A64 ? a) b) c) d)

2.

D4, D5 D4, D5 D4, D5 D4, D5

Memory locations 000490 through 000495 contain, respectively, 0A, 9C, B2, 78, 4F and C3. What does A0 and D2 contains after each instruction? (Assume that A0 contains 00000492 and that D2 contains 00000000 before each instruction executes) a) b) c)

3.

ADD.W SUB.W MULU.B DIVU.B

MOVE.B MOVE.B MOVE.W

(A0), D2 - (A0), D2 (A0) +, D2

What is the final result of D5 after this small sequence of instructions? Data register D5 initially contains 3B25AC89. ANDI.B #$2C, D5 ORI.W #$2C45, D5 NOT.W D5

4.

Data register D4 contains C9AE23A5. What are its contents after these two instructions execute? ASR.L #2, D4 ROL.W #3, D4

5.

Data register D1 contains 00000019 (25 decimal). What is its value after LSL.W #3, D1

6.

What will D3 contain after this sequence of instructions, if D2 and D3 initially contain 00000009 and 00000001 respectively? LOOP MULU D2, D3 SUBQ #1, D2 BNE LOOP

7.

Analyze the following programs. Determine the results of each of these instructions. i)

MOVE.B ADD.B

#$85, D1 #$2A, D1

ii)

MOVEA.L MOVE.W ROL.W MOVE.W

#$3000, A1 #$ABCD, D1 #2, D1 D1, (A1)

1

8.

Determine the contents of the registers and memory locations that are affected by the following MC68000 CPU instructions. The initial values inside the registers and memory locations are as shown in Table 1 and Table 2 below. Assume that before each instruction is executed, the registers and memory locations are restored to their original values. Every instruction is not related to each other. i) ii) iii) iv) v)

MOVE.L $3000, D3 MOVE.B D1,(A0) ASL.W #5, D1 ADD.W (A2), DO OR.W #$06, D2 Table 1: Initial register contents DATA REGISTERS D0 = $78904536 D1 = $FFCB5A8B D2 = $FFF81C18 D3 = $0000186A

ADDRESS REGISTERS A0 = $00003000 A1 = $00003001 A2 = $00003002 A3 = $00003003

Table 2: Initial memory contents ADDRESS $3000 $3001 $3002 $3003

9.

DATA $52 $6A $06 $7D

Figure 1 shows the MC68230 Pl/T connection to a 7-segment display unit. Draw the flowchart and write a MC68000 CPU assembly language program that will display the number " 1 " , when switch SW1 is pressed, and display the number "2", when switch SW2 is pressed. All other states of SW1 and SW2 causes the display to show number "0".

Figure 1

2

Related Documents

Emai Uitm
May 2020 4
Laporan Uitm
May 2020 3
Calender Uitm
June 2020 2