11
6.0 RESULTS 1. Part A Register Content Memory Content D0 0000 0012 $2000 0012 D1 0000 0056 $3000 0012 D2 0000 0012 D3 Table 1.1

MicroP Lab Report 2

Embed Size (px)

DESCRIPTION

Lab report for Micro Processor

Citation preview

Page 1: MicroP Lab Report 2

6.0 RESULTS

1. Part A

Register Content Memory ContentD0 0000 0012 $2000 0012D1 0000 0056 $3000 0012D2 0000 0012D3

Table 1.1

Page 2: MicroP Lab Report 2

2. Part B

Instruction Before Execution After ExcutionMOVEQ #10,D0 D0 = 0000 0000 D0 = 0000 000AADDI.B #3,D0 D0 = 0000 000A D0 = 0000 000DSUBI.B #-2,D1 D1 = 0000 0000 D1 = 0000 0002MOVE.L #1234,D2 D2 = 0000 0000 D2 = 0000 1234MOVE.L$FFF8,D3 D3 = 0000 0006 D3 = 0000 FFF8MULU D2,D3 D3 = 0000 FFF8 D3 = 1234 6E60MOVE.W #$FFFFFFFF,D4 D4 = 0000 0000 D4 = 0000 FFFFMULS #$FFFF,D4 D4 = 0000 FFFF D4 = 0000 0001MOVE.L #$000000014,D5 D5 = 0000 0000 D5 = 0000 0014DIVU #3,D5 D5 = 0000 0014 D5 = 0002 0006MOVE.L #-3,D6 D6 = 0000 0000 D6 = FFFF FFFDMOVE.W #20,D7 D7 = 0000 0000 D7 = 0000 0014DIVS D6,D7 D7 = 0000 0014 D7 = 0002 FFFA

Table 1.2

3. Part C

Page 3: MicroP Lab Report 2

Line

Label Opcode Operan Effect Comment

1 FIRST EQU $2000 Declare the instruction

2 BYTES EQU $04 Declare the instruction

3 VALUE EQU $AA Declare the instruction

4 ORG $1000 As a starting address for this program

5 MOVEA.L #FIRST,A0 A0 = 0000 2004 The initial address

6 MOVE.W #BYTES,D0 D0 = 0000 0004 The value of D0

7 NEXT MOVE.B #VALUE,(A0) A0 = 0000 2000 Move the value into $AA

8 ADDA.L #1,A0 A0 = 0000 2001 Stored data from address $2000 to $2004

9 SUB.L #1,D0 D0 = 0000 0003 The value of D0 will be substitute

10 BNE NEXT Program will continuously looping

11 END $1000 The program will ended

Table 1.3

Page 4: MicroP Lab Report 2

7.0 QUESTION / DISCUSSION

1. Write a simple program that follow the step below.

Page 5: MicroP Lab Report 2

2. if D0 contain $FFFFFFFF,what will be the effect of the instruction MOVE.W #50,D0 to the content of D0 ?

Before Execution After ExecutionD0 = FFFF FFFF D0 = FFFF 0032

3. The Initial value for D0 and D1 in hexadecimal are as follows.

i.

Page 6: MicroP Lab Report 2

ii.

Page 7: MicroP Lab Report 2

4.Write a program based on the given instruction

Page 8: MicroP Lab Report 2

5. What is the function of data register D0 in the above program.

The function is to restored data from memory to register after execution the program.

6. Stated one of the program control instruction used in the given problem and explain what is the function of that instruction briefly.

Move . L, is used to copy data in long word size from memory to register,register to memory,register to register and memory to memory.

7. Find the contents of register D0 after execution of the following 68000 instruction sequence.

EXT.W D0 = 0000 FFFF

EXT.L D0 = FFFF FFFF

Page 9: MicroP Lab Report 2

8. Write a 68000 assembly program to add a 16 bit number in the low word ( bits 0-15) of D0 another 16 bit number in the high word ( bit 16-31) of D1. Store the result in the high word of D1.

8.CONCLUSION

As the result,will be able to understand or know about the basic instruction for using the program 68K, also will be able to write the instruction correctly depending the on the program and will be able to determine the position of processed data with the correct function. The basic instruction incude data movement which are data and address, the data movement means the data move from one place to another such as register to register,register to memory,memory to register and memory to memory