Sie sind auf Seite 1von 3

EXPERIMENT MP2: MICROPROCESSOR APPLICATIONS Related course: KEEE 3235 (Microprocessor and Microcontroller) OBJECTIVES: 1.

To write program using MC683332ACPV 16 board 2. To write two programs by using code such as MOVE, ADD, MUL, DlV to test the bits in memory EQUIPMENT: Microcomputer, MC 683332ACPV 16 board PRECAUTIONS: Basic operation manual is provided REFERENCE(S): Refer to the main references of KEEE 3235 (Microprocessor and Microcontroller) TEST: TEST 1: Exp Program 1 TEST 2: Exp program 2 TEST 1: Program 1 Write a program that move a block of data start from the memory location $3000- $30I0 to $4000- $4010
ORG MOVEA.L MOVEA.L MOVE.B CMPA.L BNE END $1000 #$3000,A0 #$4000,A1 (A0)+,(A1)+ #$3011,A0 LOOP

LOOP

Below are the steps how to use the board MC683332ACPV 16: 1. Key in the program CPU32Bug> MM 1 000;DI
00001000 00000000 ORI. B . . 00001014 00000000 ORI.B 00001018 00000000 ORl.B

(1000 is the starting address of the program)


#$0,D0?MOVEA.L #$3000,A0<CR>

#$0,D0?BNE.W<CR> #$0,D0?<CR>

(Dot for end to key in the program) 2. Check program CPU32Bug> MM 1000 1014;DI (1014 is the ending o f the address)

Last updated on 19th January 2014

00001000 00001006 0000100C 0000100E 00001014

207C0000 3000 227C0000 4000 12D8 B1FC0000 3011 6600FFF6

MOVEA.L MOVEA.L MOVE.B CMPA.L BNE.W

#$3000,A0 #$4000,A1 (A0)+,(A1)+ #$3011,A0 $100C

3. Key in data CPU32Bug> MM 3000;B 00003000 00003001


. .

(B:Byte, W: Word, L:Long)

00? 1A <CR> 00? 2C<CR> 00? D3<CR> 00? . <CR>

00003010 000030 I I

4. Check data CPU32Bug> MD 3000 3010;B CPU32Bug> MD 4000 4010;B 5. Execute program CPU32Bug> G 1000 <CR> 6. Check the answer CPU32Bug> MD 4000 4010;B

TEST 2: Program 2 Write a program to add the word stored in memory location $3000- $3007.The answer in type of word will be store in location $4000.If overflow occurs, the answer in location $4000 will have a value of -I ($FF).
ORG MOVEA.L CLR.L ADD.W BVS.L CMPA.W BNE.W MOVE.W BRA MOVE.W END $1000 #$3000,A1 D1 (A1)+,D1 ERROR #$3008,A1 CONT D1,$4000 OUT #FFFF,$4000

CONT

ERROR OUT

CPU32Bug>MD 1000 1020;Dl

Last updated on 19th January 2014

00001000 00001006 00001008 0000100A 00001010 00001014 00001018 0000101C 00001020

227C0000 3000 4281 D259 69FF0000 0014 B2FC3008 6600FFF2 31CI4000 60000008 31FCFFFF 4000

MOVEA.L CLR.L ADD.W BVS.L CMPA.W BNE.W MOVE.W BRA.W MOVE.W

#$3000,A1 D1 (A1)+,D1 $1020 #$3008,A1 $1008 D1,($4000).W $1026 #$FFFF,($4000).W

Exercises: 1. An Array, A (I) with 20 16-bit signed number is given, wrile a program to generate 2 new array P (J) and N (K). P (J) will include all posilive number and N (K) will include all negative number. A (I) start from the address $3000 while P (J) and N (K) will start from $4000 and $5000 respectively. 2. Write a program to read the word from memory location $3000. This program will search for two -bit occurs consequently, which is 01. If it is found, the count will be increased by 1. The answer is stored in register 01. The 16- bit is as follow: 0110010110101000 Count = 5

END OF EXPERIMENT

Last updated on 19th January 2014

Das könnte Ihnen auch gefallen