MANUAL
MANUAL
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
SYLLABUS
CS6412/IT6411 MICROPROCESSOR AND MICROCONTROLLER LABORATORY
LT P C
0 0 3 2
OBJECTIVES:
LIST OF EXPERIMENTS:
TOTAL: 45 PERIODS
CYCLE 1:
8086 MICROPROCESSOR
CYCLE 2:
CYCLE 3:
INTERFACING (8086&8051)
1. STEPPER MOTOR.
2. PARALLEL COMMUNICATION(8255)
3. DIGITAL TO ANALOG CONVERTOR (DAC).
4. COUNTER DESIGN.
5. KEYBOARD AND DISPLAY.
6. TRAFFIC LIGHT CONTROLLER.
7. DIGITAL CLOCK
8. SERIAL AND PARALLEL INTERFACE
MASM EXPERIMENTS
NOTE : The Assembler only finds syntax errors : It will not tell you whether program does what it is
supposed to do. To determine whether your program works, you have to run the program and test it.
Next step is to process the object file with linker.
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform basic arithmetic and
logical operation using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
FLOW CHART:
I6-BIT ADDITION
PROGRAM:
16-BIT ADDITION
ADDRES LABE MNEMONI
S L CS
MOV
1000 BX,2000
MOV AX,
1003 [BX]
1005 INC BX
1006 INC BX
MOV CX,
1007 [BX]
1009 MOV DL,00
100B ADD AX,CX
100D JNB XXX
100F INC DL
1011 XXX INC BX
1012 INCBX
MOV
1013 [BX],AX
1015 INC BX
1016 INC BX
MOV
1017 [BX],DL
1019 HLT
WITHOUT CARRY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202 1302
1203
WITH CARRY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202 1302
1203
1.B 16 BIT SUBTRACTION
ALGORITHM:
FLOW CHART:
I6-BIT SUBTRACTION
PROGRAM:16-BIT SUBTRACTION
1200 1300
1201 1301
1202 1302
1203
WITH BORROW
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202 1302
1203
FLOW CHART:
16-BIT MULTIPLICATION
PROGARM:
ADDRESS LABEL MNEMONICS
1000 MOV BX,2000
1003 MOV AX,[BX]
1005 INC BX
1006 INC BX
1007 MOV CX,[BX]
1009 MOV DX,00
100B MUL CX
100D INC BX
100E INC BX
100F MOV [BX],AX
1011 INC BX
1012 INC BX
1013 MOV [BX],DX
1015 HLT
SAMPLE INPUT AND OUTPUT
16-BIT MULTIPLICATION
WITHOUT CARRY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202 1302
1203 1303
FLOW CHART:
16-BIT DIVISION
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV BX,2000
1003 MOV AX,[BX]
1005 INC BX
1006 INC BX
1007 MOV CX,[BX]
1009 MOV DX,00
100B DIV CX
100D INC BX
100E INC BX
100F MOV [BX],AX
1011 INC BX
1012 INC BX
1013 MOV [BX],DX
1015 HLT
SAMPLE INPUT AND OUTPUT
16-BIT DIVISION
WITHOUT REMAINDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202
WITH REMAINDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201 1301
1202
Algorithm
PROGRAM:
LOGICAL OR OPERATION:
ADDRESS LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
1005 MOV BL,[SI+01]
1007 OR AL,BL
100A MOV [SI+02],AL
1OOD HLT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201
1200 1300
1201
LOGICAL NAND OPERATION:
ADDRES
S LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
MOV BL,
1005 [SI+01]
1008 AND AL,BL
100A NOT AL
MOV
100C [SI+02],AL
100F HLT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201
VIVA QUESTIONS
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform ascending and
descending order using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 4: Compare the numbers and exchange if necessary so that the two numbers are
in ascending order/descending order.
STEP 6: Get the third number from the array and repeat step no:4 until CX is 0.
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3000 3000
3001 3001
3002 3002
3003 3003
3004 3004
3005 3005
3006 3006
3007 3007
3008 3008
3009 3009
FLOW CHART:
DESCENDING:
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV DX,0005
1003 DEC DX
1004 ZZZ MOV CX,DX
1006 MOV SI,3000
1009 YYY MOV AX,[SI]
100D CMP AX,
[SI+02]
100E JNB XXX
1010 XCHG
[SI+02],AX
1013 XCHG [SI],AX
1015 XXX ADD SI,0002
1019 LOOP YYY
101B DEC DX
101C JNE ZZZ
101E HLT
SAMPLE INPUT AND OUTPUT
DESCENDING ORDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3000 3000
3001 3001
3002 3002
3003 3003
3004 3004
3005 3005
3006 3006
3007 3007
3008 3008
3009 3009
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform largest and smallest
number among N numbers using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 6: Get the third number from the array and repeat step no:4 until CX is 0.
LARGEST NUMBER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4000 5000
4001 5001
4002
4003
4004
4005
4006
4007
4008
4009
SMALLEST NUMBER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4000 5000
4001 5001
4002
4003
4004
4005
4006
4007
4008
4009
CONCLUSION:
CODECONVERSIONS
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BCD to BINARY
and vice versa using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
BCD TO BINARY
STEP 1: Start the program.
STEP 2: Get the input data.
STEP 3: performing AND operation between input and F0.
STEP 4: Rotate right AL with CL.
STEP 5: performing multiplication operation between DH and 0A.
STEP 6: Store the CONCLUSION in memory.
STEP 7: Stop the program.
BINARY TO BCD
STEP 1: Start the program.
STEP 2: Get the input data.
STEP 3: compare and then subtract the value 100 from the input.
STEP 4: compare and then subtract the value 10 from the input.
STEP 5: performing rotate left operation with AL by 04.
STEP 6: Store the CONCLUSION in memory.
STEP 7: Stop the program.
FLOW CHART:
PROGRAM:
BCD TO BINARY
1100 1101
BINARY TO BCD
BINARY TO BCD
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
2001
2000
2002
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BINARY TO ASCII
and vice versa using 8086 microprocessor.
COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
ALGORITHM:
ASCIITO BINARY
STEP 1: Start the program.
STEP 3: If the input data is greater than the data 0A add 37 from input otherwise add
30 from the input.
BINARY TO ASCII
STEP 1: Start the program.
STEP 3: If the input data is greater than the data 0Asubtract 37 from input otherwise
subtract 30 from the input.
ASCII TO BINARY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
2000 2001
2000 2001
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BINARY TO
GRAY.
COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
ALGORITHM:
STEP 3: Rotate the input content to right and then store in another register.
FLOW CHART:
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8200 8201
CONCLUSION:
Exp. No
DATE:
OBJECTVE:
To write and execute an assembly language program for performing the decimal operation of 16 bit
numbers with carry.
COMPONENTS REQUIRED:
ALGORITHM:
Step1: Start
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
MATRIX OPERATION
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to Add and Subtract two 3x3
matrix using 8086 microprocessor.
COMPONENTS REQUIRED:
FLOW CHART:
PROGRAM: ADDITION OF TWO MATRICES
ALGORITHM:
CONCLUSION:
STRING OPERATIONS
DATE:
OBJECTVE:
To write and execute an assembly language program to move a block of data without overlap
using 8086
COMPONENTS REQUIRED:
8086 Trainer kit, Key board, power supply, MASM Software
ALGORITHM
Initialize counter
Initialize source block pointer
Initialize destination block pointer
Get the byte from source block
Store the byte in the destination block
Increment source, destination pointers and decrement counter
Repeat steps 4,5 and 6 unit counter equal to zero
Stop
PROGRAM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
Exp. No:
DATE:
OBJECTVE:
To write and execute an assembly language program to move a block of data using string
instructions.
COMPONENTS REQUIRED:
8086 Trainer kit, Key board, power supply, MASM Software
ALGORITHM
Initialize counter
Initialize source block pointer
Initialize destination block pointer
Get the byte from source block
Store the byte in the destination block
Increment source, destination pointers and decrement counter
Repeat steps 4,5 and 6 unit counter equal to zero
Stop
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV SI,2000
1003 MOV DI,3000
1006 MOV CX,000F
1009 CLD
100A XXX MOVSB
100B LOOP XXX
100D HLT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform search operation
using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 3: Compare elements to be found with set of elements one by one until if count
becomes zero.
STEP 4: Stop the program
FLOW CHART
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 03 1200 00
1101 01
1102 40
1103 02
1104 08
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 03 1200 FF
1101 01
1102 42
1103 02
1104 08
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform find and replace
operation using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 3: Compare elements to be found with set of elements one by one until if count
becomes zero.
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
FINDING THE LENGTH OF A STRING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to find the length of a string
using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
COMPARING A STRING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform to compare a string
using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 1: Start the program.
STEP 2: Set the DI to point the source array
STEP 3: Move the string size to CX register
STEP 4: Move the data to AL
STEP 5: Direction flag is cleared so that SI & DI will auto increment after each loop.
STEP 6: Repeat
STEP 7: Store the bytes of string using MOVSB instruction.
STEP 8: Stop the program.
PROGRAM:
CONCLUSION:
REVERSING A STRING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to reverse a string using 8086
microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
EXPT NO:
16 – BIT ADDITION USING MASM
DATE:
OBJECTIVE:
To write a MASM program to perform 16–bit arithmetic operations using instruction set of 8086
microprocessor.
COMPONENTS REQUIRED:
MASM software, Personal Computer.
ALGORITHM:
PROGRAM:
.model small
.code
start:
mov ax,4000h
mov bx,4000h
add ax,bx
int 3
end start
OUTPUT:
INPUT OUTPUT
ALGORITHM:
PROGRAM:
.model small
.code
start:
mov ax,4000h
mov bx,4000h
sub ax,bx
int 3
end start
OUTPUT:
INPUT OUTPUT
ALGORITHM:
PROGRAM:
.model small
.code
start:
mov ax,0008h
mov bx,0004h
mul bx ;32 bit answer available in dx#ax reg;
int 3
end start
OUTPUT:
INPUT OUTPUT
ALGORITHM:
PROGRAM:
.model small
.code
start:
mov ax,0000h
mov dx,0001h
mov bx,0002h
div bx ;quotient in ax;remainder in dx;
int 3
end start
OUTPUT:
INPUT OUTPUT
CONCLUSION:
EXPT NO:
DATE:
OBJECTIVE:
To write a MASM program to perform logical operations using instruction set of 8086
microprocessor.
COMPONENTS REQUIRED:
MASM software, Personal Computer.
ALGORITHM:
PROGRAM:
.model small
.code
start:
mov al,85h
mov bl,99h
and al,bl
int 3h
end start
OUTPUT:
INPUT OUTPUT
LOGICAL OR OPERATION
.model small
.code
start:
mov al,85h
mov bl,99h
or al,bl
int 3h
end start
OUTPUT:
INPUT OUTPUT
.model small
.code
start:
mov al,85h
not al
int 3h
end start
OUTPUT:
INPUT OUTPUT
LOGICAL NAND OPERATION
.model small
.code
start:
mov al,85h
mov bl,99h
and al,bl
not al
int 3h
end start
OUTPUT:
INPUT OUTPUT
.model small
.code
start:
mov al,85h
mov bl,99h
or al,bl
not al
int 3h
end start
OUTPUT:
INPUT OUTPUT
.model small
.code
start:
mov al,85h
mov bl,99h
xor al,bl
int 3h
end start
OUTPUT:
INPUT OUTPUT
CONCLUSION:
OBJECTIVE:
To write a MASM program to perform sorting operations using instruction set of 8086
microprocessor.
COMPONENTS REQUIRED:
MASM software, Personal Computer.
ALGORITHM:
PROGRAM:
DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CH,04H
DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2
INT 3
CODE ENDS
END START
OUTPUT:
INPUT OUTPUT
PROGRAM:
DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CH,04H
UP2: MOV CL,04H
LEA SI,STRING1
UP1:MOV AL,[SI]
MOV BL,[SI+1]
CMP AL,BL
JNC DOWN
MOV DL,[SI+1]
XCHG [SI],DL
MOV [SI+1],DL
DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2
INT 3
CODE ENDS
END START
OUTPUT:
INPUT OUTPUT
CONCLUSION:
DATE:
OBJECTIVE: To write a MASM program to perform displaying system time using instruction set of
8086 microprocessor.
MASM Program:
.MODEL SMALL
.STACK 100
.DATA
String1 DB 'The Time is'
String2 DB 2 DUP (0), ':'
String3 DB 2 DUP (0), ':'
String4 DB 2 DUP (0), 0Dh, 0Ah, '$'
Hours DB 0
Minutes DB 0
Seconds DB 0
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS, AX
MOV AH,2Ch
INT 21h
MOV Hours, CH
MOV Minutes, CL
MOV Seconds, DH
LEA BX, String2 + 2
XOR AX,AX
MOV AL, Hours
CALL Numasc
MOV [BX], AX
LEA BX, String3 + 2
XOR AX,AX
MOV AL, Minutes
CALL Numasc
MOV [BX], AX
LEA BX, String4 + 2
XOR AX,AX
MOV AL, Seconds
CALL Numasc
MOV [BX],AX
LEA DX, String1
MOV AH,00
MOV AL,03
INT 10h
MOV AH,09h
INT 21h
MOV AH, 08H ;4Ch
INT 21h
MAIN ENDP
NUMASC PROC
MOV AH,00
MOV DL,10
DIV DL
OR AX,3030h
RET
NUMASC ENDP
END
OUTPUT:
CONCLUSION:
The MASM Program to perform displaying system time using instruction set of 8086 microprocessor has
been written and executed successfully.
PRINTER STATUS CHECKING USING MASM
EXPT NO:
DATE:
OBJECTIVE: To write a MASM program to check the status of printer using instruction set of 8086
microprocessor.
name printmsg
page 60,80
title program to send a message to printer
.model small
.stack 64
.data
msg db 'If this is Printed on paper',0dh,0ah
db 'Then Program is Working',0dh,0ah
len equ $-msg
errmsg db 'Error! Printer is not connected or switched off',0dh,0ah,'$'
.code
main:
mov ax,@data
mov ds,ax
mov ah,02h ;get printer status
mov dx,0 ;printer 0
int 17h ;returns with ah=status
rol ah,01 ;if ah7=1 then printer is ready | mov ah7 to carry flag
jc online
offline:
lea dx,errmsg
mov ah,09h ;displays errmsg
int 21h
jmp exit
online:
mov cx,len
mov si,00h
mov ah,05h ;prints the char in dl on printer
again:
mov dl,msg[si]
int 21h
inc si
loop again ;dec cx,until cx=0
exit:
mov ah,4ch
int 21h
end main
CONCLUSION:
DATE:
OBJECTIVE: To write a MASM program to generate time delay using instruction set of 8086
microprocessor.
MASM Program:
.model small
.data
msgin db 'enter delay duration(0-50);$'
msg1 db 'WELCOME TO CHENNAI!$'
delaytime dw 0000h
.code
mov dx,@data
mov ds,dx
lea dx,msgin
mov ah,09h
int 21h
in1: mov ah,01h
int 21h
cmp al,0dh
je nxt
sub al,30h
mov dl,al
mov ax,bx
mov cl,0ah
mul cl
mov bx,ax
and dx,00ffh
add bx,dx
mov delaytime,bx
loop in1
nxt: mov cx,delaytime
mov dl,10
mov ah,02h
int 21h
lea si,msg1
lp:push dx
mov dl,[si]
cmp dl,'$'
je nxt2
mov ah,02h
int 21h
add si,1
pop dx
mov di,delaytime
mov ah,0
int 1ah
mov bx,dx
delay: mov ah,0
int 1ah
sub dx,bx
cmp di,dx
ja delay
loop lp
nxt2: mov ah,4ch
int 21h
end
OUTPUT:
CONCLUSION:
DATE:
OBJECTIVE: To write a MASM program to check Password using instruction set of 8086
microprocessor.
MASM Program:
name checkpassword
page 60,80
title to check for password using DOS function call
.model small
.stack 64
.data
cr equ 13
lf equ 10
password db 'INDIA$'
prompt db 'Enter Password & then <cr> (Max 40 chars)',cr,lf,'$'
entry db 41 dup(?)
msgsuc db 'You are Authorized person',cr,lf,'$'
msgfail db 'Wrong Password! Try Again',cr,lf,'$'
.code
pass:
mov ax,@data
mov ds,ax
mov es,ax
lea dx,prompt
mov ah,09h
int 21h
mov bp,0
tryagain:
mov cx,40
mov bx,0
again:
mov ah,08h ;read a char from KB w/o echoing on screen
int 21h ;stores the char read in al
cmp al,0dh ;cmp al with <cr>(0dh)
je action
mov entry[bx],al ;store the chars read in entry[]A
inc bx
loop again ;to read next char from KB
action:
mov entry[bx],'$' ;store $ at the end of the array
lea si,password
lea di,entry
mov cx,06 ;cx=6 length of the password
repe cmpsb ;cmp si(password) & di(entry)
je sucmsg
lea dx,msgfail
mov ah,09h
int 21h
jmp tryagain
sucmsg:
lea dx,msgsuc
mov ah,09h
int 21h
mov ah,4ch
int 21h
end pass
OUTPUT:
CONCLUSION:
EXPT NO:
DATE:
OBJECTIVE: To write a MASM program to check whether the given string is palindrome or not
using instruction set of 8086 microprocessor.
MASM Program:
DATA SEGMENT
STR1 DB "ENTER YOUR STRING HERE ->$"
STR2 DB "YOUR STRING IS ->$"
STR3 DB "REVERSE STRING IS ->$"
INSTR1 DB 20 DUP("$")
RSTR DB 20 DUP("$")
NEWLINE DB 10,13,"$"
N DB ?
S DB ?
MSG1 DB "STRING IS PALINDROME$"
MSG2 DB "STRING IS NOT PALINDROME$"
A DB "1"
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,INSTR1
;GET STRING
MOV AH,09H
LEA DX,STR1
INT 21H
MOV AH,0AH
MOV DX,SI
INT 21H
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,STR2
INT 21H
MOV AH,09H
LEA DX,INSTR1+2
INT 21H
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,STR3
INT 21H
MOV CL,INSTR1+1
ADD CL,1
ADD SI,2
L1:
INC SI
DEC SI
LEA DI,RSTR
DEC SI
INC DI
LOOP L2
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,RSTR
INT 21H
MOV AH,09H
LEA DX,NEWLINE
INT 21H
LEA SI,INSTR1
LEA DI,RSTR
MOV AH,09H
LEA DX,NEWLINE
INT 21H
ADD SI,2
L7:
MOV BL,BYTE PTR[DI]
INC SI
INC DI
MOV BL,BYTE PTR[DI]
MOV AH,02H
MOV DL,BL
INT 21H
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,MSG1
INT 21H
JMP L5
LL2:
MOV AH,09H
LEA DX,NEWLINE
INT 21H
MOV AH,09H
LEA DX,MSG2
INT 21H
L5:
MOV AH,4CH
INT 21H
CODE ENDS
END START
CONCLUSION:
EXP NO.:
DATE:
OBJECTIVE: To connect two 8086 microprocessor kits and to serially communicate with
each other by considering transmitter and receiver kits.
COMPONENTS REQUIRED:
Procedure
4. Interface the two kits with 9-9 serial cable in the serial port of the microprocessor kits. (LCD kit means
PC-PC cable. LED kit means kit-kit cable)
5. Enter the data in transmitter kit use the memory location 1500.
RECEIVER PROGRAM:
8279 INTERFACE
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of keyboard and
display Using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 1: Start the program.
STEP 2: Initialize 8279 with 8 digits of display by sending command (00) to port.
STEP 3: Locate the first digit address with auto increment mode by sending
command(90) to port..
STEP 4:Send seven- segment code(3F)for ”0”.
STEP 5: Send seven- segment code(3F)for ”1”..
STEP 6: Send seven- segment code(3F)for ”2”..
STEP 7: Send seven- segment code(3F)for ”3”..
STEP 8: stop the program.
DISPLAYING A SINGLE CHARACTER
FLOW CHART:
PROGRAM:
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of counterusing 8086
microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 1: Start the program.
STEP 2: Set a control word for counter 2 in mode -3(Square wave generation).
STEP 3: Give the lower byte of count value
STEP 4:Give the higher byte of count value.
STEP 5: Stop the program.
PROGRAM:
OBSERVATION
S.No TIME PERIOD(msec) AMPLITUDE (volts)
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing stepper motor
Using 8086 microprocessor.
COMPONENTS REQUIRED:
ALGORITHM:
FLOW CHART:
CLOCKWISE DIRECTION:
ANTI-CLOCKWISE DIRECTION
90° PHASE SHIFT:
PROGRAM:
ADDRES LABE
S L MNEMONICS
0400 MOV AL,80
0402 OUT 76,AL
STAR
0404 T MOV AL,FA
0406 OUT 70,AL
CALL 0423
0408 (DELAY)
040B MOV AL,F6
040D OUT 70,AL
CALL 0423
040F (DELAY)
0412 MOV AL,F5
0414 OUT 70,AL
CALL 0423
0416 (DELAY)
0419 MOV AL,F9
041B OUT 70,AL
CALL 0423
041D (DELAY)
JMP 0404
0421 (START)
DELA
0424 Y MOV CX,0000
0427 LP1 DEC CX
0428 JNZ LP1
0429 RET
CONCLUSION:
OBJECTIVE :
To display the digital clock specifically by displaying the hours, minutes and seconds
using 8086 kits
COMPONENTS required :
ALGORITHM:
HARDWARE INSTALLATION:
STEP 2: Connect RTC Interfacing module to 50 Pin Bus of 8086 Trainer Kit through 50 pin FRC
Cable.
STEP 3: Be sure about the direction of the cable i.e. pin No. 1 of module should be connected to Pin
No. 1 of 50 pin connector.
STEP 4: Connect +5V, GND from the trainer kit (+5V & GND signals are available in the 50 pin of
FRC Connector).
SOFTWARE INSTALLATION :
STEP 1: Enter the program from 0:400 of 8086 Kit. Make sure that your program is entered properly
before execution.
STEP 2: Execute your program from respective location & observe the results.
PROGRAM:
CONCLUSION:
OBJECTIVE :
COMPONENTS required :
PROGRAM:
CONCLUSION:
DAC INTERFACING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of DAC
Using 8051 microcontroller.
COMPONENTS REQUIRED:
ALGORITHM:
SQUARE WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send it to the D/A convertor.
STEP 3: Call a delay of 1ms which is the off-time delay.
STEP 4:Initialize D/A convertor by sending FF to the output port.
STEP 5: Call a delay of 1ms which is the on-time delay.
STEP 6: Repeat the loop.
TRIANGULAR WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send it to the D/A convertor.
STEP 3: Increment the data and send it to the accumulator.
STEP 4:Repeat the loop until Accumulator reaches 00.
STEP 5: Load accumulator with FF and send it to the D/A convertor.
STEP 6: Decrement the data and send it to the accumulator.
STEP 7:Repeat the loop until Accumulator reaches 00.
STEP 8:Repeat the process again and again.
SAWTOOTH WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send
it to the D/A convertor.
STEP 3: Increment the data and send it to the
accumulator.
STEP 4:Repeat the process unconditionally.
FLOW CHART:
SQUARE WAVE
SAWTOOTH WAVE:
TRIANGULAR WAVE:
PROGRAM:
Square wave generation:
ADDRES
S LABEL MNEMONICS
0400 MOV AL,80
0402 OUT 76,AL
0404 MOV AL,00
0406 OUT 70,AL
0408 OUT 72,AL
040A MOV AL,FF
040C OUT 70,AL
040E OUT 72,AL
0412 HLT
OBSERVATION
S.No TIME PERIOD(msec) AMPLITUDE (volts)
CONCLUSION:
ADC INTERFACING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of ADC
Using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV AL,98
1002 OUT 76,AL
1004 KKK MOV AL,00
1006 OUT 72,AL
1008 MOV AL,00
100A OUT 74,AL
100C MOV AL,03
100E OUT 74,AL
1010 MOV AL,00
1012 OUT 74,AL
1014 PPP IN 74,AL
1016 AND AL,10
1018 JE PPP
101A MOV AL,04
101C OUT 74,AL
101E IN AL,70
1020 MOV(1300),AL
1024 JMP KKK
1027 HLT
CONCLUSION:
TRAFFIC LIGHT CONTROLLER (TLC) INTERFACING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of traffic light
controller using8086 microprocessor .
COMPONENTS REQUIRED:
ALGORITHM:
STEP 1: Start the program.
STEP 2: Initialize all the three ports of 8255 as output ports.
STEP 3: Turn on DON’T WALK signals in all the roads.
STEP 4: Turn on GO signal in road 1.
STEP 5: Turn on READY signal in road 2 and STOP signal in all other roads.
STEP 6: Turn on GO signal in road 2.
STEP 7: Turn on READY signal in road 3 and STOP signal in all other roads.
STEP 8: Turn on GO signal in road 3.
STEP 9: Turn on READY signal in road 4 and STOP signal in all other roads
STEP 10: Turn on GO signal in road 4
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV AL,80
1002 OUT 76,AL
1004 MOV AL,11
1006 OUT 70,AL
1008 OUT 74,AL
100A CALL DELAY1
100D START MOV AL,44
100F OUT 70,AL
1011 CALL DELAY1
1014 MOV AL,22
1016 OUT 70,AL
1018 CALL DELAY2
101B MOV AL,99
101D OUT 70,AL
1022 MOV AL,22
1024 OUT 70,AL
1026 CALL DELAY2
1029 MOV AL,11
102B OUT 70,AL
102D MOV AL,44
102F OUT 74,AL
1031 CALL DELAY1
1034 MOV AL,22
1036 OUT AL,22
1038 CALL DELAY2
103B MOV AL,99
103D OUT 74,AL
103F CALL DELAY1
1042 MOV AL,22
1044 OUT 74,AL
1046 CALL DELAY2
1049 MOV AL,11
104B OUT 74,AL
104D JMP START
1050 DELAY1 MOV BX,000F
1053 DELAY2 MOV CX,0FFF
1056 DL 1 DEC CX
1057 JNZ DL1
1059 DL 1 DEC BX
105A JNZ DL2
105B RET
BIT PATTERNS
5029 B4 60 09 20
502D 9C 40 0B 05
5031 96 40 0B 20
5035 E4 40 0B 05
5039 A4 41 0B 20
503D B4 40 0E 05
5041 B4 40 1A 20
5045 31 12 23 10
5049 B4 C0 09 05
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 8-bit arithmetic
operations using 8051 micro controller.
COMPONENTS REQUIRED:
ALGORITHM:
FLOW CHART:
PROGRAM:
ADDITION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ADD A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
SUBTRACTION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#04
3005 SUB A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
MULTIPLICATION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#04
3005 MUL AB
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
DIVISION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#02
3005 DIV AB
3007 MOV DPTR,#4500
3009 MOVX @DPTR,A
300A INC DPTR
300B MOV A,B
300C MOV @DPTR,A
300F SJMP 300F
CONCLUSION:
LOGICAL OPERATIONS
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 8-bit logical
operations using 8051 micro controller.
COMPONENTS REQUIRED:
ALGORITHM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
OR LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3004 ORL A,B
3005 MOV DPTR,#4500
3008 MOVX @DPTR,A
3009 SJMP 3009
NOR LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ORL A,B
3007 CPL A
3008 MOV DPTR,#4500
300B MOVX @DPTR,A
300C SJMP 300C
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
NAND LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ANL A,B
3007 CPL A
3008 MOV DPTR,#4500
300B MOVX @DPTR,A
300C SJMP 300C
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
XOR LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 XRL A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 3009
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform two’s complement
of a number using 8051 micro controller.
COMPONENTS REQUIRED:
ALGORITHM:
STEP 3: Complement the input data and then add with 01.
FLOW CHART:
PROGRAM:
ONE”S COMPLEMENT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
TWO”S COMPLEMENT:
ADDRESS LABEL MNEMONICS
3000 MOV A,#02
3002 CPL A
3003 INC A
3004 MOV DPTR, #4500
3007 MOVX @DPTR,A
3008 SJMP 300A
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to find square of a number
using 8051 microcontroller.
COMPONENTS REQUIRED:
FLOWCHART:
PROGRAM:
SQUARE OF A NUMBER:
ADDRESS LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,A
3004 MUL AB
3005 MOV DPTR,#4500
3008 MOVX @DPTR,A
3009 SJMP 3009
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CUBE OF A NUMBER:
ALGORITHM:
FLOWCHART:
PROGRAM:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,A
3004 MUL AB
3005 MOV B,A
3007 MOV A,#02
3009 MUL AB
300A MOV DPTR,#4500
300D MOVX @DPTR,A
300F SJMP 300F
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to convert UNPACKED BCD
TO ASCII using 8051 microcontroller.
COMPONENTS REQUIRED:
PROGRAM:
ADDRES
S LABEL MNEMONICS
MOV A,#41H
MOV B,A
SUBB A,#40H
JC LABEL1
MOV A,B
SUBB A,#37H
MOV R0,A
SJMP HERE
LABEL1 MOV A,B
:
CLR C
SUBB A,#30H
MOV R0,A
HERE: SJMP HERE
CONCLUSION:
ADDITIONAL EXPERIMENTS USING 8086
FINDING THE SUM OF ‘N’ NUMBERS
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to find sum of ‘n’ numbers
using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
ADDRES LABE
S L MNEMONICS
1000 MOV CL,00
1002 MOV DL,00
1004 MOV SI,2000
1007 MOV AL,00
1009 XXX MOV AL,[SI]
100B INC SI
100C JNC YYY
100E INC DI
1010 YYY LOOP XXX
1012 MOV [3000],DL
1016 MOV [3001],AL
101A HLT
SAMPLE INPUT AND OUTPUT
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to find the factorial of a given
number using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
CONCLUSION:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 1’s and 2’s
complement using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
CONCLUSION:
PALINDROME CHECKING
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to check whether the given
string is palindrome or not using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM:
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to generate Fibonacci series
using 8086 microprocessor.
COMPONENTS REQUIRED:
PROGRAM
ADDRE LABE MNEMONIC
SS L S
MOV SI,1200
MOV CL,[SI]
INC SI
MOV AL,00
MOV [SI],AL
INC SI
INC AL
MOV [SI],AL
SUB CL,02
XXX DEC SI
MOV AL,[SI]
INC SI
MOV BL,[SI]
ADD AL,BL
INC SI
MOV [SI],AL
LOOP XXX
HLT
EX NO:
DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to simulate LED Blinking.
COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
PROGRAM
LABE MNEMONIC
ADDRESS L S
1000 MOV SI,[1200]
1003 MOV CL,[SI]
1005 INC SI
1006 MOV AL,00
1008 MOV [SI],AL
100A INC SI
100B INC AL
100E SUB CL,02
1012 XXX DEC SI
1015 INC SI
1016 MOV BL,[SI]
101A INC SI
101B MOV [SI],AL
101D LOOP XXX
101F HLT
CONCLUSIO
N: