Beruflich Dokumente
Kultur Dokumente
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
#$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)
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
227C0000 3000 4281 D259 69FF0000 0014 B2FC3008 6600FFF2 31CI4000 60000008 31FCFFFF 4000
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