Microprocessor File
Microprocessor File
Microprocessor File
EXPERIMENT 1
AIM:
Familiarization with 8086 trainer kit
APPARATUS:
ESA 8086 Trainer kit
THEORY:
In the minimal working of configuration of a microprocessor, we consider a memory, keyboard,
display system and I/O ports along with the CPU. In general all these devices are called
peripheral devices.
ESA 86/88 3 is an advanced general purpose microcomputer system that can be operated
either with 8086 or 8088 CPU and provides the user a powerful and complete tool for
programming and applications development. They have 16 bit wide data bus.
SYSTEM CAPABILITIES:
1.
2.
3.
4.
5.
6.
7.
SPECIFICATIONS:
CPU: 8086/88 running at 8 MHz in maximum mode.
Memory: 67EDEC 32 pin sockets provide the following memory configuration.
Coprocessor: 8087
RAM: 256 KB using 628128
512 KB using 628512
EPROM: 128 KB using 27512
256 KB using 27010
ANSHUMAN, 111405
Microprocessor |-2-
INTERRUPTS:
1. External:
a. NMI: Non Maskable Interrupt
b. INTR: Controlled by on board 8259A PIC
2. Internal:
a. Single Step Interrupt
b. INT instruction interrupt
INTERFACING OPTIONS:
POWER SUPPLIES:
5V at 1.5A (max)
12V at 250mA (max) for ADC
DIMENSIONS:
(L) 365mm (B) 1275mm (H) 55mm approx.
SCOPE OF SUPPLY:
ANSHUMAN, 111405
Microprocessor |-3-
EXPERIMENT - 2
AIM:
To perform following arithmetic operations:
i) A= B+C ii) A=B*C iii) A=(B+C-D)*3 iv) ABC+D *C
APPARATUS:
ESA 86 3 trainer kit, Power Supply
PROGRAM:
i) A=B+C
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2008
MOV
MOV
ADD
INT
AX, 0013
BX, 0014
AX,BX
03
OUTPUT:
AX = 001B
SI = 0000
IP = 2008
BX = 000F
DI = 0000
CX = 0000
DS = 0000
DX = 0000
SS = 0000
SP = 0000
ES = 0000
BP = 0000
CS = 0000
SP = 0000
ES = 0000
BP = 0000
CS = 0000
ii) A=B*C
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2008
MOV
MOV
MUL
INT
AX, 0013
BX, 0014
BX
03
OUTPUT:
AX = 00B6
SI = 0000
IP = 2008
BX = 000F
DI = 0000
CX = 0000
DS = 0000
ANSHUMAN, 111405
DX = 0000
SS = 0000
Microprocessor |-4-
iii) A=(B+C-D)*3
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2008
0000:200B
0000:200E
0000:2010
OUTPUT:
AX = 004B
SI = 0000
IP = 2010
BX = 0002
DI = 0000
CX = 0000
DS = 0000
DX = 0000
SS = 0000
SP = 0000
ES = 0000
BP = 0000
CS = 0000
SP = 0000
ES = 0000
BP = 0000
CS = 0000
iv) ) ABC+D *C
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2008
0000:200B
0000:200D
0000:2010
0000:2013
0000:2015
0000:2018
0000:201A
0000:201B
MOV
MOV
MUL
MOV
MUL
MOV
ADD
NOT
MOV
MUL
NOT
INT
AX, 0002
BX, 0003
BX
BX,0006
BX
BX, 0004
AX, BX
AX
BX, 0002
BX
AX
03
OUTPUT:
AX = 0051
SI = 0000
IP = 201B
BX = 0002
DI = 0000
CX = 0000
DS = 0000
ANSHUMAN, 111405
DX = 0000
SS = 0000
Microprocessor |-5-
EXPERIMENT - 3
AIM:
Write a program to find the average of two numbers.
APPARATUS:
ESA 86 3 trainer kit, Power Supply
PROGRAM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2008
0000:200B
0000:200D
MOV
MOV
ADD
MOV
DIV
INT
AX,0010
DX,0016
AX, BX
CX, 02
CX
03
OUTPUT:
AX = 000D
SI = 0000
IP = 200D
BX = 0016
DI = 0000
CX = 0000
DS = 0000
ANSHUMAN, 111405
DX = 0000
SS = 0000
SP = 0000
ES = 0000
BP = 0000
CS = 0000
Microprocessor |-6-
EXPERIMENT 4
AIM:
Write a program to find the factorial of a given number
APPARATUS:
Power Supply, ESA 86 3 trainer kit
PROGRAM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2008
0000:200A
0000:200C
0000:200D
0000:200F
0000:2011
0000:2013
0000:2100
OUTPUT:
AX = 0078
SI = 2100
IP = 2013
BX = 0000
DI = 0000
CX = 0000
DS = 0000
ANSHUMAN, 111405
DX = 0000
SS = 0000
SP = 0100
ES = 0000
BP = 0000
CS = 0000
Microprocessor |-7-
EXPERIMENT 5
AIM:
Write a program to arrange numbers in (a) ascending order and (b) descending order.
APPARATUS:
ESA 86 3 trainer kit, Power Supply
PROGRAM:
4(a) Program to arrange numbers in ascending order:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2007
0000:2009
0000:200C
0000:200F
0000:2011
0000:2012
0000:2014
0000:2016
0000:2018
0000:201A
0000:201C
0000:201E
0000:2020
0000:2022
0000:2024
0000:2025
0000:2027
0000:202B
0000:202D
0000:202F
0000:2031
0000:2033
MOV AX,0000
MOV DS,AX
MOV BL,05
MOV CL,BL
MOV SI,2100
MOV DI,3100
MOV AL,[SI]
INC SI
DEC CL
JZ 2022
CMP AL,[SI]
JNA 2011
MOV AH,AL
MOV AL,[SI]
MOV [SI],AH
JMP 2011
MOV [DI],AL
INC DI
MOV SI,DI
SUB SI,1000
DEC BL
JZ 2033
MOV CL,BL
JMP 200F
INT 03
ORG 2100
DB 05 0A 0F 1F 04
0000:2100
ANSHUMAN, 111405
Microprocessor |-8-
OUTPUT:
0000:3100
04 05 0A 0F 1F
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2007
0000:2009
0000:200C
0000:200F
0000:2011
0000:2012
0000:2014
0000:2016
0000:2018
0000:201A
0000:201C
0000:201E
0000:2020
0000:2022
0000:2024
0000:2025
0000:2027
0000:202B
0000:202D
0000:202F
0000:2031
0000:2033
MOV AX,0000
MOV DS,AX
MOV BL,05
MOV CL,BL
MOV SI,2100
MOV DI,3100
MOV AL,[SI]
INC SI
DEC CL
JZ 2022
CMP AL,[SI]
JNB 2011
MOV AH,AL
MOV AL,[SI]
MOV [SI],AH
JMP 2011
MOV [DI],AL
INC DI
MOV SI,DI
SUB SI,1000
DEC BL
JZ 2033
MOV CL,BL
JMP 200F
INT 03
ORG 2100
DB 05 0A 0F 1F 04
0000:2100
OUTPUT:
0000:3100
1F 0F 0A 05 04
ANSHUMAN, 111405
Microprocessor |-9-
EXPERIMENT - 6
AIM:
Write a program to generate Triangular waveform.
APPARATUS:
Power Supply, ESA 86/88-3, 8086 kit, CRO
PROGRAM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200C
0000:200F
0000:2010
0000:2012
0000:2015
0000:2017
0000:201A
0000:201D
0000:201E
0000:2020
0000:2023
0000:2025
0000:2027
0000:2028
0000:2029
0000:202A
0000:202B
OUTPUT:
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 10 -
EXPERIMENT - 7
AIM:
Write a program to generate Square waveform.
APPARATUS:
Power Supply, ESA 86/88-3, 8086 kit, CRO
PROGRAM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200C
0000:200F
0000:2010
0000:2013
0000:2015
0000:2018
0000:201B
0000:201C
0000:201F
0000:2021
0000:2023
0000:2024
0000:2025
0000:2026
0000:2027
OUTPUT:
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 11 -
EXPERIMENT - 8
AIM:
Write a program to interface a stepper motor with 8086. Also write a program to change its
speed and rotate it in clockwise and anti-clockwise directions.
APPARATUS:
Power Supply, ESA 86 - 3 trainer kit, Stepper Motor
PROGRAM:
7(a) Program to rotate Stepper Motor in Clockwise direction:
With speed of 7 RPM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200B
0000:200C
0000:200F
0000:2011
0000:2013
0000:2016
0000:2018
0000:2019
OUTPUT:
Stepper motor rotates in CLOCKWISE direction with a speed of 7 RPM.
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 12 -
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200B
0000:200C
0000:200F
0000:2011
0000:2013
0000:2016
0000:2018
0000:2019
OUTPUT:
Stepper motor rotates in CLOCKWISE direction with a speed of 14 RPM.
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200B
0000:200C
0000:200F
0000:2011
0000:2013
0000:2016
0000:2018
0000:2019
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 13 -
OUTPUT:
Stepper motor rotates in ANTI-CLOCKWISE direction with a speed of 7 RPM.
MNEMONICS
0000:2000
0000:2003
0000:2005
0000:2006
0000:2009
0000:200B
0000:200C
0000:200F
0000:2011
0000:2013
0000:2016
0000:2018
0000:2019
OUTPUT:
Stepper motor rotates in ANTI-CLOCKWISE direction with a speed of 14 RPM.
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 14 -
EXPERIMENT 9
AIM:
Write a program to glow LED using relays.
APPARATUS:
Power Supply, ESA 86 - 3 trainer kit, LED, 16 relays.
PROGRAM:
ADDRESS
MNEMONICS
0000:2000
0000:2003
0000:2006
0000:2007
0000:200A
0000:200D
0000:200E
0000:2011
0000:2012
0000:2014
0000:2016
0000:2019
0000:201A
0000:201B
0000:201E
0000:201F
0000:2021
0000:2023
0000:2025
0000:2027
0000:2029
0000:202C
0000:202D
0000:202E
0000:2031
0000:2032
0000:2034
0000:2036
0000:2038
0000:203A
0000:203D
0000:203E
0000:2041
MOV AX, 80
MOV DX, 0FFE6
OUT DX, AX
START: MOV AX, 0000
MOV DX, 0FFE0
OUT DX, AX
MOV DX, 0FFE2
OUT DX, AX
INC AL
MOV BL, 08
LOOP1: MOV DX, 0FFE0
OUT DX, AX
PUSH AX
CALL 203D
POP AX
MOV CL, 01
ROL CL, AL
DEC BL
JNE 2016
MOV BL, 08
LOOP2: MOV DX, 0FFE2
OUT DX, AX
PUSH AX
CALL 203D
POP AX
MOV CL, 01
ROL AL, CL
DEC BL
JNE 2029
JMP 2007
DELAY: PUSH CX
MOV CX, 0FFFF
SAME: LOOP 2041
ANSHUMAN, 111405
M i c r o p r o c e s s o r | - 15 0000:2043
0000:2044
0000:2045
POP CX
RET
INT 03
OUTPUT:
LEDs corresponding to each relay glows in a serial pattern.
ANSHUMAN, 111405