Sei sulla pagina 1di 39

LABORATORY MANUAL

MICROPROCESSORS & INTERFACING


(III B.Tech., CSE- I Sem.)

Department of Electronics & Communication


Engineering

BALAJI INSTITUTE OF ENGINEERING &


SCIENCES
Dept. of Electronics & Communication Engineering

Laknepally, Narsampet, Warangal

Dept. of Electronics & Communication Engineering

BALAJI INSTITUTE OF TECHNOLOGY AND SCIENCE


Laknepally, Narsampet, Warangal

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGG.

LIST OF PROGRAMMS
Name of the Lab : MICROPROCESSORS AND INTERFACING LAB
Class

: III B.Tech., CSE

Regulation

: R 07

1. WRITE 8086 ALP TO ADD,SUB,MUL,DIV TWO 16-BIT NUMBERS


2. WRITE 8086 ALP TO DIVIDE A 32-BIT BY A 16-BIT UNSIGNED
NUMBER
AND STORE RESULT IN STACK SEGMENT
3. WRITE 8086 ALP TO SORT THE GIVEN ARRAY OF 32-BIT
NUMBERASCENDING &DESCENDING ORDER.
4. WRITE 8086 ALP TO PICK THE MEDIAN FROM THE GIVEN ARRAY
OF
NUMBERS
5. WRITE 8086 ALP TO FIND THE LENGTH OF A STRING.
6. WRITE 8086 ALP TO REVERSE THE STRING AND VERIFY
WHETHER IT IS
A PALINDROME.
7. WRITE 8086 ALP TO A PROCESSOR TO VERIFY THE PASSWORD.
8. WRITE A PROGRAM TO DELETE A CHARACTER FROM STRING.
9. WRITE 8086 ALP TO A PROCESSOR TO CALL A DELAY
SUBROUTINE
AND DISPLAY THE CHARACTER ON THE LED DISPLAY.
10. WRITE 8086 ALP TO A PROCESSOR DISPLAY THE KEY NUMBER
PRESSED ON THE 7-SEGMENT DISPLAY
11. WRITE 8086 ALP TO A INTERFACE A STEPPER MOTOR.
12. WRITE 8086 ALP TO A PROCESSOR INTERFACE AN 8-BIT ADC.
Dept. of Electronics & Communication Engineering

13. WRITE 8086 ALP AN ADC TO GENERATE RAMP, TRIANGULAR,


SQUARE, RECTANGULAR WAVEFORMS WITH DIFFERENT
PERIODS

EXPERIMENT NO. 1
INTRODUCTION MASM / TASM

Dept. of Electronics & Communication Engineering

INTRODUCTION TO MASM/TASM
Assembler:
An assembler program is used to translate the assembly language
mnemonics for instruction to corresponding binary codes called Object
code, when you run the assembler, it reads the source file of your
program called Assembly Program. Where saved it after editing on the
first pass through the same program the assembler determines offset of
labels and pairs this information in a symbol table, on the second pass
through the source program, the assembler produce the binary code for
each instruction and inserts the offset etc., that is calculated during the
first pass. The assembler generates one file. The file is called Object file,
is given the extension .obj. The object file contains the binary codes for
the instruction and information about the address of the instructions. The
model of assembler is sown in the below figure.

Assembler Directives
An assembler is used to convert the assembly language to machine
code language and to find out some syntax errors. The logical errors and
proportional errors are not found out by the assembler. For completing all
these tasks, the programmer should give some hints in the program to
assembler, in clearly understanding the program.
Assembler directives are predefined Alphabetical strings which give
hints to assembler, to clearly understand the program in preparing the
code well.
They are also called as pseudo instructions during assembling
operation, no machine codes are generated for assembler directives.
VERSION OF ASSEMBLER: Microsoft Macro Assembler6.11
1 .586

: This directive is used to select Pentium instruction


set available in MASM 6.11

2 .model <model type>: This directive is used to select the


programming model depending upon the program.
Dept. of Electronics & Communication Engineering

Model Type
Tiny
Small
Medium
Large

Description
All data & codes must be fit in to one segment 64kB
One data segment 64kB & one code segment 64kB
One data segment 64kB & more than one code segment
More than one data segment & more than one code
segment
Only available to 6.11 version. It uses one segment of
512kB to store data & codes

Flat
3 .data

: This directive indicates start of data segment,


following the data.

4 DB (define byte): This is used to reserve the byte or bytes of


memory or string in the available memory.
5 DW(define word): This is used to reserve a word of memory
locations, instead of bytes.
6 DD(define double word): This is used to reserve a double word
(32bits) of memory locations.
7 MESSAGE DB GOOD MORNING
This makes the assembler to reserve the number of
bytes of memory locations equal to the number of characters in
the string named Message.
8 .code

: This directive indicates start of code segment,


following the program.

9 End

: This directive informs the assembler that


assembling operations should be stopped.

10 Proc
11 Endp

: This directive informs the assembler about start of procedure.


: This directive informs the assembler about end of procedure.

12 Endm

: This directive informs the assembler about end of macro.

Procedure:
Dept. of Electronics & Communication Engineering

Step1: Switch on the system.


Step2: Go to START button.
Step3: Go to RUN & press ENTER.
Step4: Type CMD & press ENTER. This will open command prompt.
Step5: Type command cd masm\pentium\<your directory>
Step6: Open the new file with .ASM extension.
Step7: Write the program, save it.
Step8: Copy few batch files using copy c:\masm\pentium\*.bat.
Then three batch files get copied.
Step9: Execute the written program using following commands
C:\masm\pentium\>ml <file name>
C:\masm\pentium\>wl32 <file name>
C:\masm\pentium\>cwd <file name>
Step10: The above command will open a debugger window, press F8
keys to execute the program in steps.
Repeat the same procedure for every program, except coping of Batch
files is done for once.
Flat
15 .data

Only available to 6.11 version. It uses one segment of


512kB to store data & codes
: This directive indicates start of data segment,
following the data.

16 DB (define byte): This is used to reserve the byte or bytes of


memory or string in the available memory.
17 DW(define word): This is used to reserve a word of memory
locations, instead of bytes.
18 DD(define double word): This is used to reserve a double word
(32bits) of memory locations.
19 MESSAGE DB GOOD MORNING
This makes the assembler to reserve the number of
bytes of memory locations equal to the number of characters in
the string named Message.
Dept. of Electronics & Communication Engineering

20 .code

: This directive indicates start of code segment,


following the program.

21 End

: This directive informs the assembler that


assembling operations should be stopped.

22 Proc
23 Endp

: This directive informs the assembler about start of procedure.


: This directive informs the assembler about end of procedure.

24 Macro

: This directive informs the assembler about start of macro.

25 Endm

: This directive informs the assembler about end of macro.

Procedure:
Step1: Switch on the system.
Step2: Go to START button.
Step3: Go to RUN & press ENTER.
Step4: Type CMD & press ENTER. This will open command prompt.
Step5: Type command cd masm\pentium\<your directory>
Step6: Open the new file with .ASM extension.
Step7: Write the program, save it.
Step8: Copy few batch files using copy c:\masm\pentium\*.bat.
Then three batch files get copied.
Step9: Execute the written program using following commands
C:\masm\pentium\>ml <file name>
C:\masm\pentium\>wl32 <file name>
C:\masm\pentium\>cwd <file name>
Step10: The above command will open a debugger window, press F8
keys to execute the program in steps.
Repeat the same procedure for every program, except coping of Batch
files is done for once.

Dept. of Electronics & Communication Engineering

EXPERIMENT NO. 2
ARITHMETIC OPERATIONS

Dept. of Electronics & Communication Engineering

1) WRITE 8086 ALP TO ADD,SUB,MUL,DIV TWO 16-BIT NUMBERS


Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:XOR AX,AX
MOV ES,AX
MOV DI,3000
XOR BX,BX
XOR CX,CX
XOR DX,DX
MOV AX,5555
MOV BX,2222
ADD AX,BX
MOV [DI],AX
INC DI
INC DI
MOV AX,5555
SUB AX,BX
MOV [DI],AX
INC DI
INC DI
MOV AX,5555
MUL BX
MOV [DI],AX
INC DI
INC DI
INC DI
INC DI
MOV AX,5555
XOR DX,DX
DIV BX
MOV [DI],AX
INC DI
INC DI
MOV[DI],DX
INT 03
I/P:AX=5555

BX=2222

O/P: ES:DI
0000:3000 77}
0000:3001 77 } Add(AX)
0000:3002 33}
Dept. of Electronics & Communication Engineering

0000:3003
0000:3004
0000:3005
0000:3006
0000:3007

33} Sub(AX)
4A}
9F} AX
60}
0B } DX MUL(AX,DX)

0000:3008 02}
0000:3009 00} AX Quotient}
0000:300A 11}
0000:300B 11} DX Reminder } DIV

Flow chart:

Dept. of Electronics & Communication Engineering

Start
Get the first number
Get the second number
ADD the two numbers

Carry=0

Is
carry
flag
set

Carry=1

Store result and carry


in memory

Stop

2) WRITE 8086 ALP TO DIVIDE A 32-BIT BY A 16-BIT UNSIGNED


NUMBER AND STORE RESULT IN STACK SEGMENT
Apparatuses:Dept. of Electronics & Communication Engineering

1.8086 mp kit -1& Adopter-1


2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:XOR AX,AX
XOR BX,BX
XOR CX,CX
MOV SS,AX
MOV SP,5004
MOV AX,5678
MOV DX,1234
MOV BX,5678
DIV BX
PUSH DX
PUSH AX
INT 03
I/P:AX,DX=1234 5678

BX=5678

O/P: SW 5000
0000:5000 -35E5
0000:5002 -2520

3) WRITE 8086 ALP TO SORT THE GIVEN ARRAY OF 32-BIT


NUMBER
ASCENDING &DESCENDING
ORDER.
Apparatuses:1.8086 mp kit -1& Adopter-1
Dept. of Electronics & Communication Engineering

2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:-

L1:
L2:

L3:

XOR AX,AX
MOV CL,06
DEC CL
MOV DL,CL
MOV SI,5000
MOV CL,DL
MOV AL,[SI]
CMP AL,[SI]01
JL L3
XCHG AL,[SI]01
MOV [SI],AL
INC SI
LOOP L2
DEC DL
JNZ L1
INT 03

I/P: 0000:5000-7E
01-34
02-4B
03-2F
04-5C
05-1D
Result: O/p:
0000:5000-1D
5001-2F
5002-34
5003-4B
5004-5C
5005-7E
AX=001D

FL= F046

Dept. of Electronics & Communication Engineering

start

Initialize the source pointer and counter

Get the first number

yes

Larg
er

Exchange the numbers


Set SWAP flag
Increment address

DEC CMP Count

Is it
0
yes

Sto
p[

SWA
P
Flag(
1)

Dept. of Electronics & Communication Engineering

DESCENDING ORDER.

L1:
L2:

L3:

XOR AX,AX
MOV CL,06
DEC CL
MOV DL,CL
MOV SI,5000
MOV CL,DL
MOV AL,[SI]
CMP AL,[SI]01
JG L3
XCHG AL,[SI]01
MOV [SI],AL
INC SI
LOOP L2
DEC DL
JNZ L1
INT 03

Result: O/p:
0000:5000-7E
5001-5C
5002-4B
5003-34
5004-2F
5005-1D
AX=007E

FL= F047

4) WRITE 8086 ALP TO PICK THE MEDIAN FROM THE GIVEN ARRAY
OF NUMBERS

Dept. of Electronics & Communication Engineering

Apparatuses:1.8086 mp kit -1& Adopter-1


2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:XOR AX,AX
XOR BX,BX
XOR CX,CX
XOR DX,DX
MOV DS,AX
MOV BL,O8
MOV DL,BL
L2: MOV SI,3000
MOV CL,BL
L1:MOV AL,[SI]
CMP AL,[SI]01
JBE L
XCHG AL,[SI]01
XCHG AL,[SI]
L:INC SI
LOOP L1
DEC DL
JNZ L1
MOV CL,BL
MOV AL,BL
MOV SI,3000
MOV DL,02
SHR CL,01
JC L3
CALL 4000
JMP L4
L3:CALL 5000
L4:INT 03
SUB ROUTINE:1 (EVEN)
DIV DL
ADD SI,AX
MOV AL,[SI]
DEC SI
ADD AL,[SI]
DIV DL
RET
SUB ROUTINE:2(ODD)
DIV DL
XOR AH,AH
ADD SI,AX
Dept. of Electronics & Communication Engineering

MOV AL,[SI]
RET
I/P: 0000:3000-02
01-01
02-05
03-04
04-03
05-08
06-07
07-06
O/P : (EVEN OUTPUT) 0000:3000-01
01-02
02-03
03-04
04-05
05-06
06-07
07-08
BL=08

AX= 0104

FL=F097

CF=1

PF=1(Even no.of 1s)

O/P : (ODD OUTPUT) 0000:3000-01


01-02
02-03
03-04
04-05
05-06
06-07
07-08
CF=0

PF=0(Odd no.of 1s)

5) WRITE 8086 ALP TO FIND THE LENGTH OF A STRING


Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:Dept. of Electronics & Communication Engineering

XOR AX,AX
XOR BX,BX
XOR CX,CX
MOV DS,AX
MOV SI,3000
L1: MOV AL,[SI]
CMP AL,00
JE L
INC BX
INC SI
JMP L1
INT 03
I/P: 0000:3000-01
01-02
02-03
03-04
04-05
05-06
06-07
07-00

O/P: BX=0007

FL=F046

PF=1(Even no.of 1s)

CF=0(No carry)

6) WRITE 8086 ALP TO REVERSE THE STRING AND VERIFY


WHETHER IT IS A PALINDROME.
Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:Dept. of Electronics & Communication Engineering

XOR AX,AX
XOR BX,BX
XOR CX,CX
XOR DX,DX
MOV SI,3000
MOV DI,4000
MOV DS,AX
MOV ES,AX
L: MOV AL,[SI]
MOV [DI],AL
INC SI
DEC DI
LOOP L
MOV DI,4000
MOV SI,3000
MOV CX,08
REP
CMPSB
INT 03
I/P: 0000:3000-01
01-02
02-03
03-04
04-05
05-06
06-07
07-00
O/P: 0000:4000-00
FL=F046
ZF=1 (Given string is
PALINDROME STRING)
02-02
03-03
CF=0 (No carry)
PF =1(Even no.of 1s)
04-03
05-02
06-01
07-00

Dept. of Electronics & Communication Engineering

star
t
Get string address
Get the string length
Get the string last char address
Get CHAR
Display
Decrement address

Decrement length

Is
it
zer
o
stop

7) WRITE 8086 ALP TO A PROCESSOR TO VERIFY THE PASSWORD.


Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. RS 232 Serial cable.
4.+5v Supply
Dept. of Electronics & Communication Engineering

5.86/88e Driver Software.


Program:XOR AX,AX
MOVAX,2000
MOV DS,AX
MOV SI,1000
MOV AX,2200
MOV ES,AX
MOV DI,1500
MOV AX,2500
MOV SS,AX
MOV SP,2000
MOV CX,0005
CLD
REPE CMPSB
L1:JNE L3
CALL 1000:0200(S1)
L2:JMP
L3:CALL 1000:0300(S2)
L4:INT 03
(S1) SUBROUTINE TO DISPLAY VALID
1000:0200 MOV AX,2000
MOV DS,AX
MOV BX,1100
INT AC
INT AF
RET
(S2) SUBROUTINE TO DISPLAY INVALID
1000:0300 MOV AX,2000
MOV DS,AX
MOV BX,1200
INT AC
INT AF
RET
I/P 1:2000:1000-04
01-07
02-48
03-12
04-A1
I/P 2:2000:1500-04
01-07
02-48
Dept. of Electronics & Communication Engineering

03-12
04-A1
I/P 3:2000:1100-56(V)
01-41(A)
02-4C(L)
03-49(I)
04-44(D)
05-03
I/P 4:2000:1200-49(I)
01-4E(N)
02-56(V)
03-41(A)
04-4C(L)
05-49(I)
06-44(D)
07-03
O/P: WAIT
VALID
COMMAND.

8) WRITE A PROGRAM TO DELETE A CHARACTER FROM STRING


Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. RS 232 Serial cable.
4.+5v Supply
5.86/88e Driver Software.
Program:XOR AX,AX
MOVAX,2000
MOV DS,AX
Dept. of Electronics & Communication Engineering

LEA DI,STRING
MOV CX,LEN
MOV AL,CHAR
CLD
REPNE SCASB
JNZ EXIT
MOV SI,DI
DEC DI
REP MOVSB
EXIT:MOVBYTE PTR[DI], $
LEA DX,STRING
MOV AH,09
INT 21H
INT 03

Dept. of Electronics & Communication Engineering

star
t
Get string address
Get the string length
Clear DF
Scan the string

Char
found
zero

Delete character from string

Print the string

stop

9) WRITE 8086 ALP TO A PROCESSOR TO CALL A DELAY


Dept. of Electronics & Communication Engineering

SUBROUTINE AND DISPLAY THE CHARACTER ON THE LED DISPLAY.


Apparatuses:1.8086 mp kit -1& Adopter-1
2. System-1
3. seven segment kit.
4.bus
5.serial cable
Program:XOR AX,AX
L1:MOV BL,01 H
MOV CL,04
MOV AX,2000
MOV DS,AX
MOV SI,1000
L2:MOV AL,[SI]
MOV DX,PORT A ADDRES
OUT DX,AL
MOV AL,BL
MOV DX,PORT B ADDRES
OUT DX,AL
INC SI
ROL AL,01
MOV BL,AL
L3:LOOP L2
L4:JMP L1
TO TURN ON LEDS:000:0001-01(Will turn on LED 1)
0010-02(LED 2)
0100-04(LED 3)
1000-08(LED 4)
CODE TO DISPLAY: 8-7F
0-3F
8-7F
6-7D

10) WRITE 8086 ALP TO A PROCESSOR DISPLAY THE KEY NUMBER


PRESSED ON THE 7-SEGMENT DISPLAY
Apparatuses:1.8086 mp kit -1& Adopter-1
Dept. of Electronics & Communication Engineering

2. System-1
3. seven segment kit.
4.bus
5.serial cable
Program:-

LOOP4:
LOOP3:
LOOP2:
LOOP1:

DELAY:

MOVW AX,0000
MOVW CX,AX
MOVW DX,AX
MOVW DX,0FFE6
MOVB AL,80
OUTB DX,AL
MOVW SI,2100
MOVB CL,05
MOVB CH,04
MOVB BL,08
MOVB AL,[SI]
INCW SI
ROLB AL,01
MOVW DX,0FFE2
OUTB DX,AL
MOVB AH,AL
MOVB AL,01
MOVW DX,0FFE4
OUTB DX,AL
DECB AL
OUTB DX,AL
MOVB AL,AH
DECB BL
JNZ LOOP1
DECB CH
JNZ LOOP2
CALL DELAY
DECB CL
JNZ LOOP3
JNZ LOOP4
PUSH CX
MOVW CX,0FFFF
LOOP $
MOVW CX,0FFFF
LOOP $
POP CX
RET
ORG 2100
DB 0FF,0FF, 0FF, 0FF
DB 0C6,086,0C7,086
DB 0BF,0C0,0DE,087
DB 0BF,092,091,092
Dept. of Electronics & Communication Engineering

DB 092,0C8,086,087

11. WRITE 8086 ALP TO A INTERFACE A STEPPER MOTOR.


Apparatuses:1.8086 mp kit
2. System-1
3. Stepper motor board.
4. Stepper motor-1
5. 8086 mp kit Adopter-1
6. Stepper Adopter-1
Program:MOVW DX,0FFE6
Dept. of Electronics & Communication Engineering

L1:

DELAY:
L2:

MOVB AL,80
OUTB AL,DX
MOVB DX,0FFE0
MOVB AL,88
OUTB AL,DX
CALL DELAY
XCHGW AX, AX
XCHGW AX, AX
RORB AL,01
JMP L1
INT 03
MOVW AX,0000
LOOP L2
RET

12) WRITE 8086 ALP TO A PROCESSOR INTERFACE AN 8-BIT ADC


Apparatuses:1.8086 mp kit
2. System-1
3. Seven segment kit
4. Bus
5. RS 232
Program:-(ADDRES 4000)
XOR AX,AX
MOV AX,0000
MOV CS,AX
Dept. of Electronics & Communication Engineering

CALLA 0FB00:0031
MOV DX,0FFE6
MOV AL,82
OUT DX,AL
JMP 4026
OR 4944
INC DI
DEC CX
PUSH SP
INC CX
DEC SP
AND [BP]41,DL
DEC SP
PUSH BP
INC BP
AND [DI],BH
AND [BX][SI],AL
CALLS FB00:0135
CS
LEA DX,@2015
MOV AX,DX
CALL FB00:0013
MOV AL,02
MOV DX,0FFE0
OUT AL,DX
XCHG AX,AX
XCHG AX,AX
XCHG AX,AX
XCHG AX,AX
XCHG AX,AX
MOV AX,0001
OUT AL,DX
MOV CX,1000
LOOP 4049
MOV AL,04
OUT AL,DX
MOV DX,OFFE2
IN AL,DX
AND AL,01
JE 405F
INC BL
JMP 4053
MOV AL,BL
CALLS FB00:0052
MOV AL,02
MOV DX,OFFE0
OUT AL,DX
MOV BX,0003
MOV CX,FFFF
Dept. of Electronics & Communication Engineering

LOOP 4072
DEC BX
JNE 406F
JMP 4079
ANDB[BX][SI],AL
PUSH ES

Dept. of Electronics & Communication Engineering

INTERFACING 8086 WITH 8255 PPI

Dept. of Electronics & Communication Engineering

13) WRITE 8086 ALP AN ADC TO GENERATE RAMP, TRIANGULAR,


SQUARE, RECTANGULAR WAVEFORMS WITH DIFFERENT PERIODS.
Program:1

RAMP WAVE GENERATION

AIM: To generate a ramp wave form by interfacing 8255 PPI with 8086 microprocessor.
APPARATUS:
1.
2.
3.
4.
5.

8086 Trainer kit


Key board
SMPS
CRO
Interfacing cable with probe

PROGRAM CODE:
MOV AL,80
MOV DX,8807
OUT DX,AL
Repeat

MOV AL,00
MOV DX,8801

Next

OUT DX,AL
INC AL
CMP AL,FF
JB

Next

JMP

Repeat

INT A5
RESULT: 8255 PPI is interfaced with 8086in mode 0 with Port A as output port.
8255 address

PORT A

8801

PORT B

8803

PORT C

8805

CWR

8807

Port A is connected to CRO to verify the program output.


Output: Ramp waveform is generated on CRO and the wave form is plotted on graph.
Peak to peak Voltage :
Time period

Dept. of Electronics & Communication Engineering

Program:2

TRIANGULAR WAVE GENERATION

AIM: To generate a triangular wave form by interfacing 8255 PPI with 8086 microprocessor.
APPARATUS:
1.
2.
3.
4.
5.

8086 Trainer kit


Key board
SMPS
CRO
Interfacing cable with probe

PROGRAM CODE:
MOV AL,80
MOV DX,8807
OUT DX,AL
Repeat

MOV AL,00
MOV DX,8801

Next

OUT DX,AL
INC AL
CMP AL,FF
JB

Again

Next

OUT DX,AL
DEC AL
CMP AL,00
JA
JMP
INT A5

Again
Repeat

RESULT: 8255 PPI is interfaced with 8086in mode 0 with Port A as output port.
8255 address

PORT A
8801
PORT B
8803
PORT C
8805
CWR
8807
Port A is connected to CRO to verify the program output.
Output: Triangular waveform is generated on CRO and the wave form is plotted on graph.
Peak to peak Voltage :
Time period
:

Dept. of Electronics & Communication Engineering

Program:3

SQUARE WAVE GENERATION

AIM: To generate a square wave form by interfacing 8255 PPI with 8086 microprocessor.
APPARATUS:
1.
2.
3.
4.
5.

8086 Trainer kit


Key board
SMPS
CRO
Interfacing cable with probe

PROGRAM CODE:
MOV AL,80
MOV DX,8807
OUT DX,AL
Repeat

MOV AL,FF
MOV DX,8801
OUT DX,AL
CALL

Delay

MOV AL,00
OUT DX,AL
CALL

Delay

JMP

Repeat

DELAY PROGRAM
MOV CX,6D
Back

NOP
NOP
LOOP

Back

RET

Dept. of Electronics & Communication Engineering

RESULT: 8255 PPI is interfaced with 8086in mode 0 with Port A as output port.
8255 address

PORT A
8801
PORT B
8803
PORT C
8805
CWR
8807
Port A is connected to CRO to verify the program output.
Output: Square waveform is generated on CRO and the wave form is plotted on graph.
Peak to peak Voltage :
Time period

ON period

OFF period

Dept. of Electronics & Communication Engineering

Program:4

RECTANGULAR WAVE GENERATION

AIM: To generate a rectangular wave form by interfacing 8255 PPI with 8086
microprocessor.
APPARATUS:
1.
2.
3.
4.
5.

8086 Trainer kit


Key board
SMPS
CRO
Interfacing cable with probe

PROGRAM CODE:
MOV AL,80
MOV DX,8807
OUT DX,AL
Repeat

MOV AL,FF
MOV DX,8801
OUT DX,AL
CALL

Delay1

MOV AL,00
OUT DX,AL
CALL

Delay2

JMP

Repeat

DELAY PROGRAM
Delay1

MOV CX,6D

Back1

NOP
NOP
LOOP

Back1

RET

Dept. of Electronics & Communication Engineering

RESULT: 8255 PPI is interfaced with 8086in mode 0 with Port A as output port.
8255 address

PORT A
8801
PORT B
8803
PORT C
8805
CWR
8807
Port A is connected to CRO to verify the program output.
Output: Recatangular waveform is generated on CRO and the wave form is plotted on graph.
Peak to peak Voltage :
Time period

ON period

OFF period

Dept. of Electronics & Communication Engineering

Dept. of Electronics & Communication Engineering

Potrebbero piacerti anche