LAB 1 Microcontroller & Application: Objective
LAB 1 Microcontroller & Application: Objective
Application
Objective:
Familiarization with the Kiel Development System and Data Transfer & Arithmetic
instructions
Procedure:
1 .Follow Steps given in the Keil Startup pdf Manual for Keil Development
Familiarization
Program 1
Put Some Value in the internal RAM address 30H, 31H, 32H of the Microcontroller
MOV
A,#30H
MOV
A,30H
MOV
R0,#31H
MOV A,R0
MOV
A,@R0
MOV
R5,#32H
MOV
A,@R5
What is the difference between the first and second instructions are
they the same?
Why this program did did not compile? What is the change that is
made to the program?
Program 2
Modify and Observe the Port pin values in the Keil Environment
MOV A,P0
MOV
R0,P1
MOV@R0,
A
Program 3
Addres Instruction
s
Affected Register
& Memory Value
MOV
DPTR,#1E1FH
MOV A,83H
MOV B,82H
MOV PSW,#18H
MOV R6,A
MOVR7,A
Program 4
Write a Program to copy data
1.
2.
3.
4.
Instruction
Program 5
Modify Program 1 and add this Instruction
Instruction
XCH A,R0
XCH A,@R1
XCHD A,@R1
Program 6
Modify the Internal Register of 30H,31H and run the program
Affected Register
& Memory Value
MOV R0,#30H
MOV R1,#30H
INC R1
INC @R1
MOV A,@R0
ADD A, @R1
INC R1
MOV @R1,A
MOV A,@R0
ADDC A,@R1
INC R1
MOV @R1,A
Program 7
Design a Program using above with SUBB instruction and DEC Instruction
with 2 parameters in 30H and 31H. Document this 3 cases
1. The end result is positive number
2. The end result is zero
3. The end result is negative number
Program 8
Instruction
MOV A, #05H
MOV B,
#0A0H
MUL AB
MOV
A,#088H
MOV B,#02H
DA A
Modify the above program for three cases and discuss the output
1. A * B is greater than 255
2. A/B where B is zero
3. Where after division A is greater than 99 what is the effect DA A
instruction