Académique Documents
Professionnel Documents
Culture Documents
Experiment No.1
Introduction to 8051 Simulation software and Familiarization of 8051
instruction set.
Execute the following programs using 8051 simulator and examine the registers and memory
locations involved.
1.
MOV A, #55H
MOV R0, A
MOV R1, A
MOV R2, A
MOV R3, #99H
MOV A, R3
2.
3.
DATA1:
DATA2:
DATA3:
DATA4:
DATA6:
ORG 500H
DB
28
DB
00111010B
DB
39H
ORG
510H
DB
2591
ORG
518H
DB
MANIPAL INSTITUTE
4.
MOV
MOV
MOV
MOV
MOV
R0,
R1,
R2,
R7,
R5,
#99H
#85H
#3FH
#63H
#12H
5.
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
PUSH
PUSH
00,
01,
02,
07,
R5,
R6,
R1,
R4,
6
1
#99H
#85H
#3FH
#63H
#12H
#25H
#12H
#0F3H
; sp=sp+1 and R6 is copied to Stack
1
Department of Biomedical Engineering, Manipal Institute of Technology, Manipal 576 104
Microcontroller Lab
6.
MOV
MOV
ADD
DA
A, #47H
B, #25H
A, B
A
7.
CLR
MOV
MOV
SUBB
C
A, #3FH
R3, #23H
A, R3
; clear carry
; data 3Fh into A
; copy 23h into R3
; A-R3 = A
8.
MOV
MOV
MUL
A, #25H
0F0H, #65H
AB
9.
MOV
MOV
DIV
A,
#95H
0F0H, #10H
AB
10.
MOV
MOV
MOV
A, #44H
P1, A
P2, A
11.
BACK:
; source pointer
; destination pointer
; counter
; get a byte from source
; copy it to destination
; increment source and destination pointer
; repeat for all 10 bytes
2
Department of Biomedical Engineering, Manipal Institute of Technology, Manipal 576 104
Microcontroller Lab
APPENDIX A
The 8051 Microcontroller Hardware
3
Department of Biomedical Engineering, Manipal Institute of Technology, Manipal 576 104
Microcontroller Lab
4
Department of Biomedical Engineering, Manipal Institute of Technology, Manipal 576 104
Microcontroller Lab
APPENDIX B
Table 1. 8051 Instruction Opcodes in Hexadecimal Order (Courtesy: ESA Pvt Ltd)
5
Department of Biomedical Engineering, Manipal Institute of Technology, Manipal 576 104