Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SYLLABUS
LAB OBJECTIVES
• Write ALP for arithmetic and logical operations in 8086 and 8051
LAB OUTCOMES
• Write ALP Program for fixed and Floating Point and Arithmetic
• Interface different I/Os with processor
• Generate waveforms using Microprocessors
• Execute Programs in 8051
• Explain the difference between simulator and Emulator
LIST OF EXPERIMENTS
Page
S.No Date Experiment Title Signature
No
16-BIT ARITHMETIC OPERATION USING 8086 & MASM
1. Addition of two 16-bit number
2. Subtraction of two 16-bit number
3. Multiplication of two 16-bit number
4. Division of two 16-bit number
16-BIT LOGICAL OPERATION USING 8086 & MASM
5. Logical AND of two 16-bit number
6. Logical OR of two 16-bit number
7. Logical XOR of two 16-bit number
DATA BLOCK TRANSFER USING 8086 & MASM
8. Data Block Transfer
CODE CONVERSION USING 8086 & MASM
9. Hexadecimal to ASCII conversion
10. ASCII to Hexadecimal conversion
DECIMAL ARITHMETIC OPERATION USING 8086 & MASM
11. Addition of two 8-bit number
12. Subtraction of two 8-bit number
MATRIX OPERATION USING 8086 & MASM
13. Addition of two n x n matrix
14. Subtraction of two n x n matrix
STRING MANIPULATION OPERATION USING 8086 & MASM
15. Store operation
16. Find and replace data
SORTING USING 8086 & MASM
17. Ascending order
18. Descending order
SEARCHING USING 8086 & MASM
19. Smallest number
20. Largest number
PASSWORD CHECKING USING MASM
DEPARTMENT OF ECE, ACT Page 3
EC8681 - MICROPROCESSORS & MICROCONTROLLERS LABORATORY III YEAR
AGNI COLLEGE OF TECHNOLOGY, CHENNAI
EX NO: 1
ADDITION OF TWO 16-BIT NUMBER
DATE:
AIM:
To write an assembly language program to add two 16 bit numbers by using 8086
Microprocessor and MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102 1202
RESULT:
Thus an assembly language program for addition of two 16-bit numbers was written using
8086 microprocessor. The program was executed using both MASM and 8086 kit and the output was
verified.
VIVA QUESTIONS:
1. Define microprocessor.
2. Name any three microprocessor manufacturing company.
3. What are the basic blocks of a microprocessor?
4. Define nibble, byte and word.
5. List the various buses of microprocessor.
EX NO: 2
SUBTRACTION OF TWO 16-BIT NUMBER
DATE:
AIM:
To write an assembly language program to subtraction of two 16 bit numbers by using 8086
microprocessor and MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102 1202
RESULT:
Thus an assembly language program for subtraction of two 16-bit numbers was written
using 8086 microprocessor. The program was executed using both MASM and 8086 kit and the
output was verified.
VIVA QUESTIONS:
EX NO: 3
MULTIPLICATION OF TWO 16-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102 1202
RESULT:
Thus an assembly language program for multiplication of two 16-bit numbers was
written using 8086 microprocessor. The program was executed using both MASM and 8086 kit
and the output was verified.
VIVA QUESTIONS:
EX NO: 4
DIVISION OF TWO 16-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102 1202
RESULT:
Thus an assembly language program for division of two 16-bit numbers was written using
8086 microprocessor. The program was executed using both MASM and 8086 kit and the output was
verified.
VIVA QUESTIONS:
EX NO: 5
Logical AND of two 16-bit
DATE:
AIM:
To write an assembly language program to logical AND of two 16 bit numbers by using 8086
Microprocessor & MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102
RESULT:
Thus an assembly language program for logical AND of two 16-bit numbers was written
using 8086 microprocessor. The program was executed using both MASM and 8086 kit and the
output was verified.
VIVA QUESTIONS:
EX NO: 6
Logical OR of two 16-bit
DATE:
AIM:
To write an assembly language program to logical OR of two 16 bit numbers by using 8086
Microprocessor & MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102
RESULT:
Thus an assembly language program for logical OR of two 16-bit numbers was written using
8086 microprocessor. The program was executed using both MASM and 8086 kit and the output was
verified.
VIVA QUESTIONS:
EX NO: 7
Logical XOR of two 16-bit
DATE:
AIM:
To write an assembly language program to logical XOR of two 16 bit numbers by using 8086
microprocessor & MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1100 1200
1102
RESULT:
Thus an assembly language program for logical XOR of two 16-bit numbers was written
using 8086 microprocessor. The program was executed using both MASM and 8086 kit and the
output was verified.
VIVA QUESTIONS:
EX NO: 8
DATA BLOCK TRANSFER
DATE:
AIM:
To write an assembly language program to transfer a block of data from one memory location
to another using 8086 and MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
Point DI at destination
1004 MOV DI,2100H
array
Number of array
1008 MOV CX,00FFH
elements in CX
OBSERVATION:
2000 2100
2001 2101
2002 2102
2003 2103
2004 2104
RESULT:
Thus an assembly language program for transferring a block of data from one memory
location to another was written using 8086 microprocessor. The program was executed using MASM
and the output was verified.
VIVA QUESTIONS:
CODE CONVERSION
USING 8086 & MASM
EX NO: 9
HEXADECIMAL TO ASCII CONVERSION
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
Compare 09H to AL
1007 CMP AL,09H
register
Compare 09H to AL
100A JE LOOP1 register if equal go
LOOP1
OBSERVATION:
1100 1200
RESULT:
Thus an assembly language program for to convert Hexadecimal to ASCII Conversion was
written using 8086 microprocessor. The program was executed using both MASM and 8086 kit and
the output was verified.
VIVA QUESTIONS:
EX NO: 10
ASCII TO HEXADECIMAL CONVERSION
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. Pc with MASM 1
ALGORITHM:
HEXA DECIMAL
If it is equal go to step
1007 JE LOOP1
LOOP1
OBSERVATION:
1100 1200
RESULT:
Thus an assembly language program for to convert ASCII to Hexadecimal conversion was
written using 8086 microprocessor. The program was executed using both MASM and 8086 kit and
the output was verified.
VIVA QUESTIONS:
EX NO: 11
ADDITION OF TWO 8-BIT NUMBER
DATE:
AIM:
To write an assembly language program to decimal addition of two 8-bit data using 8086 and
MASM software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
Initialize the CL
1008 MOV CL,00H
register
If Cy = 0 mean go to
100E JNC LOOP1
LOOP1
Increment the CL
1010 INC CL
register
OBSERVATION:
1100 1200
1101 1201
RESULT:
Thus an assembly language program to decimal addition of two 8-bit data using 8086 was written
using 8086 microprocessor. The program was executed using MASM and the output was verified.
VIVA QUESTIONS:
EX NO: 12
SUBTRACTION OF TWO 8-BIT NUMBER
DATE:
AIM:
To write an assembly language program to decimal subtraction of two 8-bit data using 8086 and MASM
software.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
Initialize the CL
1008 MOV CL,00H
register
If Cy = 0 mean go to
100E JNC LOOP1
LOOP1
Increment the CL
1010 INC CL
register
OBSERVATION:
1100 1200
1101 1201
RESULT:
Thus an assembly language program to decimal subtraction of two 8-bit data using 8086 was
written using 8086 microprocessor. The program was executed using MASM and the output was
verified.
VIVA QUESTIONS:
MATRIX OPERATION
USING 8086 & MASM
EX NO: 13
ADDITION OF TWO n x n MATRIX
DATE:
AIM:
To write an assembly language program to perform addition two n x n matrices using
8086 microprocessor and MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM
HEXA DECIMAL
Increment the SI
1013 INC SI
address value
Increment the DI
1014 INC DI
address value
If check CL#0 go to
1017 JNZ LOOP1
Loop1 label
OBSERVATION:
1100 1200
1101 1201
1102 1202
1103 1203
1200
1201
1202
1203
RESULT:
Thus an assembly language program to perform the addition of two n x n matrices was
written using 8086 microprocessor. The program was executed using MASM and the output
was verified.
VIVA QUESTIONS:
1. Define coprocessor.
2. Name any two coprocessors.
3. Mention the operating modes of 8086,
4. List any four arithmetic instructions of 8086.
5. What is the size of instruction queue in 8086?
EX NO: 14
SUBTRACTION OF TWO n x n MATRIX
DATE:
AIM:
To write an assembly language program to perform subtraction two n x n matrices using
8086 microprocessor and MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM
HEXA DECIMAL
Increment the SI
1013 INC SI
address value
Increment the DI
1014 INC DI
address value
If check CL#0 go to
1017 JNZ LOOP1
Loop1 label
OBSERVATION:
1100 1200
1101 1201
1102 1202
1103 1203
1200
1201
1202
1203
RESULT:
VIVA QUESTIONS:
EX NO: 15
STORE DATA
DATE:
AIM:
To write an assembly language program to move a byte of string length 0100 from
accumulator to destination using 8086 & MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
5. Direction Flag is cleared to SI and DI will auto increment after the loop
HEXA DECIMAL
Point DI at destination
1004 MOV DI,1100H
array
OBSERVATION:
100A 1100
1101
11FF
RESULT:
Thus an assembly language program to perform the store string operation was written
using 8086 microprocessor. The program was executed using MASM and the output was
verified.
VIVA QUESTIONS:
EX NO: 16
FIND AND REPLACE DATA
DATE:
AIM:
To write an assembly language program to find the given data in the array and
replace it with other data using 8086 and MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
HEXA DECIMAL
OBSERVATION:
1200 1200
1201 1201
1202 1202
1203 1203
1204 1204
RESULT:
Thus an assembly language program to perform find and replace string operation was
written using 8086 microprocessor. The program was executed using MASM and the output
was verified.
VIVA QUESTIONS:
SORTING
USING 8086 & MASM
EX NO: 17
ASCENDING ORDER
DATE:
AIM:
To write an assembly language program for the sorting in ascending order using 8086
microprocessor & MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
8. Move the data in memory to AX and move Data from AX to pointer address of BX
HEXA DECIMAL
Add data to BX
1016 REP ADD BX,02H
register
Move data of DI to
101D MOV CX,DI
CX
LOOP1
OBSERVATION:
1100 1100
1102 1102
1104 1104
1106 1106
RESULT:
Thus an assembly language program to sort the given data in an array in ascending order was
written using 8086 microprocessor. The program was executed using MASM and the output
was verified.
VIVA QUESTIONS:
EX NO: 18
DESCENDING ORDER
DATE:
AIM:
To write an assembly language program for the sorting in Descending order using 8086
microprocessor & MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
8. Move the data in memory to AX and move Data from AX to pointer address of BX
HEXA DECIMAL
Jump on no borrow to
100F JNB REP
rep
Add data to BX
1016 REP ADD BX,02H
register
Move data of DI to
101D MOV CX,DI
CX
OBSERVATION:
1100 1100
1102 1102
1104 1104
1106 1106
RESULT:
Thus an assembly language program to sort the given data in an array in Descending order was
written using 8086 microprocessor. The program was executed using MASM and the output
was verified.
VIVA QUESTIONS:
SEARCHING
USING 8086 & MASM
EX NO: 19
SMALLEST NUMBER
DATE:
AIM:
To write an assembly language program for the searching smallest number in an array
using 8086microprocessor & MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
8. Move the data in memory to AX and move Data from AX to pointer address of BX
HEXA DECIMAL
Add data to BX
1016 REP ADD BX,02H
register
Move data of DI to
101D MOV CX,DI
CX
OBSERVATION:
1100 1200
1102
1104
1106
RESULT:
Thus an assembly language program to searching smallest number in an array was written
using 8086 microprocessor. The program was executed using MASM and the output was
verified.
VIVA QUESTIONS:
EX NO: 20
LARGEST NUMBER
DATE:
AIM:
To write an assembly language program for the searching largest number in an array
using 8086 microprocessor & MASM.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. PC with MASM 1
ALGORITHM:
8. Move the data in memory to AX and move Data from AX to pointer address of BX
HEXA DECIMAL
Jump on no borrow to
100F JNB REP
rep
Add data to BX
1016 REP ADD BX,02H
register
Move data of DI to
101D MOV CX,DI
CX
OBSERVATION:
1100 1200
1102
1104
1106
RESULT:
Thus an assembly language program to searching largest number in an array was written using
8086 microprocessor. The program was executed using MASM and the output was verified.
VIVA QUESTIONS:
PASSWORD CHECKING
USING MASM
EX NO: 21
PASSWORD CHECKING
DATE:
AIM:
APPARATUS REQUIRED:
1. PC with MASM 1
ALGORITHM
1. Initialize memory pointer for pre-defined password and user defined data.
2. Prompt the message to the user to enter the password
3. Verify the user entered password with pre-defined password
4. If zero flag is set then go to step 6
5. Prompt message to user to enter the password again and go to step 2
6. Prompt the message to the user “Authorized person”
7. Stop the execution.
CODE SEGMENT
START: ORG 1000H
MOV AX, DATA
MOV DS, AX
LEA DX, MSG1
MOV AH, 09H
INT 21H
MOV SI, 00
UP1: MOV AH, 08H
INT 21H
CMP AL, 0DH
JE DOWN
MOV [INST+SI], AL
MOV DL,'*'
MOV AH, 02H
INT 21H
INC SI
JMP UP1
DOWN: MOV BX, 00
MOV CX, LEN
CHECK: MOV AL, [INST+BX]
MOV DL, [PASSWORD+BX]
CMP AL, DL
JNE FAIL
INC BX
LOOP CHECK
LEA DX, MSG2
MOV AH, 09H
INT 21H
JMP FINISH
FAIL: LEA DX, MSG3
MOV AH, 09H
INT 21H
FINISH: INT 3
CODE ENDS
END START
END
RESULT:
Thus the assembly language program to the pre-defined password was tested and verified.
VIVA QUESTIONS:
EX NO: 22
ADC USING 8086
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. ADC Kit 1
5. Interface card 1
6. Multimeter 1
ALGORITHM:
5. Vary the analog input (using Trim pot) & view the corresponding digital value in the
LED display.
HEXA DECIMAL
Content of AL is moved
1003 OUT C8,AL
to ALE port address
Content of AL is moved
1008 OUT C8,AL
to ALE port address
Content of AL is moved
100D OUT D0,AL
to SOC port address
Content of AL is moved
101B OUT D0,AL
to SOC port address
OBSERVATION:
Vref=
CH NO & CH NO &
EOC ALE LOW ALE HIGH
Channel
SI.No ADDRESS
number (Data (Data
(Hexa)
(Hexa)) (Hexa))
1 CHO D8 10 18
2 CH1 D8 11 19
3 CH2 D8 12 1A
4 CH3 D8 13 1B
5 CH4 D8 14 1C
6 CH5 D8 15 1D
7 CH6 D8 16 1E
8 CH7 D8 17 1F
Thus the buffer 74LS244 which transfers the converted data outputs to data bus is
selected when
A7 A6 A5 A4 A3 A2 A1 A0
=C0H
1 1 0 0 0 X X X
The I/O address for the latch 74LS174 which latches the data bus to ADD A, ADD B, ADD
C & ALE 1 & ALE 2 is
A7 A6 A5 A4 A3 A2 A1 A0
=C8H
1 1 0 0 1 X X X
The flip flop 74LS74 which transfers the D0 line status to the SOC pin of the ADC 0809 is
selected when
A7 A6 A5 A4 A3 A2 A1 A0
=D0H
1 1 0 1 0 X X X
A7 A6 A5 A4 A3 A2 A1 A0
=D8H
1 1 0 0 1 X X X
A7 A6 A5 A4 A3 A2 A1 A0
=E0H
1 1 1 0 0 X X X
JUMPER DETAILS:
J5: (Provision to connect the on board trim pot to any of the below mentioned
channels)
J6: (Provision to connect the on board trim pot to any of the below mentioned
channels)
P2:
RESULT:
Thus the program for converting an input analog signal into digital using 8086 was executed
and verified.
VIVA QUESTIONS:
1. Define Port.
2. List the types of ADC’s.
3. Give example of ADC IC.
4. What is resolution?
5. List any two machine control instructions of 8086.
EX NO: 23
SQUARE WAVEFORM GENERATION
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. DAC Kit 1
5. Interface card 1
6. Probe 1
7. CRO 1
ALGORITHM:
HEXA DECIMAL
Content of AL is moved
1003 OUT C8,AL
to DAC2 port address
Content of AL is moved
100B OUT C8,AL
to DAC2 port address
DAC1 is selected
A7 A6 A5 A4 A3 A2 A1 A0
=C0H
1 1 0 0 0 X X X
DAC2 is selected
A7 A6 A5 A4 A3 A2 A1 A0
1 1 0 0 1 X X X =C8H
MODEL GRAPH:
OBSERVATION:
RESULT:
VIVA QUESTIONS:
EX NO: 24
SAW-TOOTH WAVEFORM GENERATION
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. DAC Kit 1
5. Interface card 1
6. Probe 1
7. CRO 1
ALGORITHM:
4. Increment AL reg.
HEXA DECIMAL
Content of AL is moved
1003 LOOP1 OUT C0,AL
to DAC1 port address
If AL#0 mean go to
1007 JNZ LOOP1
loop1 label
DAC1 is selected
A7 A6 A5 A4 A3 A2 A1 A0
=C0H
1 1 0 0 0 X X X
DAC2 is selected
A7 A6 A5 A4 A3 A2 A1 A0
=C8H
1 1 0 0 1 X X X
MODEL GRAPH:
OBSERVATION:
RESULT:
VIVA QUESTIONS:
EX NO: 25
TRIANGULAR WAVEFORM GENERATION
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. DAC Kit 1
5. Interface card 1
6. Probe 1
7. CRO 1
ALGORITHM:
HEXA DECIMAL
Content of BL moved
1003 LOOP1 MOV AL,BL
to AL reg
Content of AL is moved
1005 OUT C8,AL
to DAC2 port address
Content of BL moved
100E LOOP2 MOV AL,BL
to AL reg
Content of AL is moved
1010 OUT C8,AL
to DAC2 port address
DAC1 is selected
A7 A6 A5 A4 A3 A2 A1 A0 =C0H
1 1 0 0 0 X X X
DAC2 is selected
A7 A6 A5 A4 A3 A2 A1 A0
=C8H
1 1 0 0 1 X X X
MODEL GRAPH:
OBSERVATION:
RESULT:
VIVA QUESTIONS:
EX NO: 26
ROLLING DISPLAY
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
8279
4. 1
Interfacing Kit
Interfacing
5. 1
card
ALGORITHM:
HEXA DECIMAL
Content of AL reg is
1010 OUT C2,AL moved into command
reg port address
Content of AL reg is
1015 OUT C2,AL moved into command
reg port address
Content of look-up
1017 NEXT MOV AL,[SI] table address is moved
into AL reg.
Content of AL reg is
1019 OUT C0,AL moved into data reg
port address
Jump to starting of
1021 JMP START
program.
HEXA DECIMAL
If DX#0 mean go to
1505 JNZ LOOP1
loop1 label
Return to main
1507 RET
program
LOOK-UP TABLE:
1200
1204
1208
120C
I/O DECODING:
A7 A6 A5 A4 A3 A2 A1 A0
=C2H
1 1 0 0 0 X 1 X
A7 A6 A5 A4 A3 A2 A1 A0
=C0H
1 1 0 0 0 X 0 X
SEGMENT DEFINITION:
Segment definitions of the seven segment display are shown below .The table shows the
correspondence between the data bus and output port bits of 8279.In order to light up a segment the
corresponding bit of data written into the display RAM should be “0”
Data Bus D7 D6 D5 D4 D3 D2 D1 D0
8279
A3 A2 A1 A0 B3 B2 B1 B0
output
Segments d c b a Dp g f e
0 0 0 D D K K K
DD-DISPLAY MODE:
CLEAR DISPLAY:
1 1 0 CD CD CD CF CA
CD CD CD –The lower two CD bits specify the blanking code to be sent to the segments to turn them
off while the 8279 is switching from one digit to next.
CD CD
CD – Enables clear display when CD=1. The rows of display RAM are cleared by the code set by
lower two CD bits.
CF =1, FIFO status is cleared, interrupt output line is reset .Sensor RAM pointer is set to row 0
CA- Clear All bit has the combined effect of CD and CF .It uses CD clearing code on display RAM and
clears FIFO status. It also resynchronizes the internal timing chain
1 0 0 AI A A A A
This command is written with A0=1, all subsequent writes with A0=0 will be the display RAM.
AI- Auto Increment Flag if AI=1 the row address selected will be incremented after each following
read or write to the display RAM.
OBSERVATION:
Hexa
Word d c b a dp g f e
Equivalent
RESULT:
Thus the assembly language program to interface 8279 with 8086 Microprocessor
was executed and verified.
VIVA QUESTIONS:
1. What is 8279?
2. Mention the display modes of 8279.
3. Explain the function of OUT instruction.
4. How do you program 8279 for a particular application?
5. Define 2 key lock out.
EX NO: 27
STEPPER MOTOR
DATE:
AIM:
To write an assembly language program to run the stepper motor in both forward and
reverse direction with delay using 8086 microprocessor.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
4. Interfacing kit 1
5. Stepper Motor 1
ALGORITHM:
HEXA DECIMAL
Decrement the BL
100A DEC BL
register
If ZF=1 mean go to
100C JNZ FORWD
forwd label
Decrement the BL
101B DEC BL
register
If ZF=1 mean go to
101D JNZ REVES
REVES label
Jump to start of
1022 JMP START
program
Decrement the DX
1030 LOOP1 DEC DX
register
If ZF=1 mean go to
1031 JNZ LOOP1
loop1 label
Increment the DI
1033 INC DI
register
Decrement the DX
103B LOOP2 DEC DX
register
If ZF=1 mean go to
103C JNZ LOOP2
loop2 label
LOOK UP TABLE:
FORLOOK 103F 09 05 06 0A
REVLLO 1043 0A 06 05 09
OBSERVATION:
1 1 0 0 1 09H 1 1 0 1 0 0AH
2 0 1 0 1 05H 2 0 1 1 0 06H
3 0 1 1 0 06H 3 0 1 0 1 05H
4 1 0 1 0 0AH 4 1 0 0 1 09H
A7 A6 A5 A4 A3 A2 A1 A0
=C0H
1 1 0 0 0 X X X
RESULT:
Thus the assembly language program to run the stepper motor in both forward and
reverse direction with delay using 8086 microprocessor was executed and verified
VIVA QUESTIONS:
PARALLEL INTERFACING
USING 8086
EX NO: 28
PARALLEL COMMUNICATION
DATE:
AIM:
To write an ALP to interface 8255 with 8086 and to initialize port a as input port A and
port B as output port in mode 0. The input is to be set by SPDT switches and output is to be
displayed by LED.
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
8255
4. 1
Interfacing kit
ALGORITHM:
HEXA DECIMAL
1500
RESULT:
Thus the assembly language program for interfacing 8086 with 8255 is performed and
output is verified.
VIVA QUESTIONS:
1. What is 8255?
2. List the ports of 8255.
3. Specify the operating modes of 8255.
4. Give the control word format of BSR mode.
5. Write the control word format of I/O mode.
EX NO: 29
TRAFFIC LIGHT CONTROL
DATE:
AIM:
APPARATUS REQUIRED:
1. 8086 kit 1
2. Power Card 1
3. Keyboard 1
Traffic Light
4. 1
Control Kit
ALGORITHM:
RESULT:
Thus the traffic light system is designed and tested successfully using 8086 assembly
language programming.
VIVA QUESTIONS:
EX NO: 30
ADDITION OF TWO 8-BIT DATA
DATE:
AIM:
To write an assembly language program to perform addition of two 8-bit data using
8051
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Move data1 to A
4106 MOV A,#data1
register
If CY=0 mean go to
410A JNC LOOP1
Loop1 label
OBSERVATION:
4105 4200
4107 4201
RESULT:
Thus the assembly language program for 8-bit addition using 8051 is performed and the output is
verified.
VIVA QUESTIONS:
EX NO: 31
SUBTRACTION OF TWO 8-BIT DATA
DATE:
AIM:
To write an assembly language program to perform subtraction of two 8-bit data using
8051
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Move data1 to A
4106 MOV A,#data1
register
If CY=0 mean go to
410A JNC LOOP1
Loop1 label
OBSERVATION:
4105 4200
4107 4201
RESULT:
Thus the assembly language program for 8-bit subtraction using 8051 is performed and
the output is verified.
VIVA QUESTIONS:
EX NO: 32
MULTIPLICATION OF TWO 8-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Multiply content of A
4109 MUL AB
& B reg
Move MSB of
410C MOV A,B multiply (B reg) result
to A reg
OBSERVATION:
4105 4200
4108 4201
RESULT:
Thus the assembly language program for 8-bit multiplication using 8051 is performed and the
output is verified.
VIVA QUESTIONS:
EX NO: 33
DIVISION OF TWO 8-BIT DATA
DATE:
AIM:
To write an assembly language program to perform division of two 8-bit data using 8051
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Move reminder (B
410C MOV A,B
reg) result to A reg
OBSERVATION:
4105 4200
4108 4201
RESULT:
Thus the assembly language program for 8-bit division using 8051 is performed and the output is
verified.
VIVA QUESTIONS:
EX NO: 34
LOGICAL AND OF TWO 8-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
OBSERVATION:
4101
4103 4200
RESULT:
Thus an assembly language program to perform AND operation using 8051is written and
the output is verified successfully.
VIVA QUESTIONS:
1. What is masking?
2. How to set a lower nibble?
3. List any four logical instructions of 8051.
4. Mention the timer modes of 8051.
5. What is the memory size of 8051?
EX NO: 35
LOGICAL OR OF TWO 8-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Store OR result to
4107 MOVX @DPTR,A
4200H
OBSERVATION:
4101
4103 4200
RESULT:
Thus an assembly language program to perform OR operation using 8051is written and
the output is verified successfully.
VIVA QUESTIONS:
EX NO: 36
LOGICAL XOR OF TWO 8-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
OBSERVATION:
4101
4103 4200
RESULT:
Thus an assembly language program to perform XOR operation using 8051is written and
the output is verified successfully.
VIVA QUESTIONS:
EX NO: 37
2’S COMPLEMENT OF TWO 8-BIT DATA
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
OBSERVATION:
4101 4200
4201
RESULT:
Thus an assembly language program to perform 2’s complement operation using 8051is
written and the output is verified successfully.
VIVA QUESTIONS:
SQUARE OPERATION
USING 8051
EX NO: 38
SQUARE OF AN 8-BIT DATA
DATE:
AIM:
To write an assembly language program to perform square of an 8-bit data using 8051
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Multiply content of A
4108 MUL AB
& B reg
Move MSB of
410B MOV A,B multiply (B reg) result
to A reg
OBSERVATION:
4105 4200
RESULT:
Thus the assembly language program for square of an 8-bit 8051 is performed and the output is
verified.
VIVA QUESTIONS:
1. Define baudrate.
2. List any two data transfer instructions of 8051.
3. What is immediate addressing mode?
4. State the function of RS1 and RS0 bits in the flag register of 8051.
5. Draw the pin diagram of 8051.
CUBE OPERATION
USING 8051
EX NO: 39
CUBE OF AN 8-BIT NUMBER
DATE:
AIM:
To write an assembly language program to perform cube of an 8-bit data using 8051
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
Multiply content of A
4109 MUL AB
& B reg
Multiply content of A
410F MUL AB
& B reg
Multiply content of A
4117 MUL AB
& B reg
OBSERVATION:
4105 4200
4201
4202
RESULT:
Thus the assembly language program for cube of an 8-bit 8051 is performed and the output is
verified.
VIVA QUESTIONS:
CODE CONVERSION
USING 8051
EX NO: 40
UNPACKED BCD TO ASCII
DATE:
AIM:
APPARATUS REQUIRED:
1. 8051 kit 1
2. Power Card 1
3. Keyboard 1
ALGORITHM:
PROGRAM:
HEXA DECIMAL
OBSERVATION:
4105 4200
4201
RESULT:
Thus the assembly language program for convert unpacked BCD to ASCII using 8051 is performed
and the output is verified.
VIVA QUESTIONS:
1. Define DPTR.
2. If a12Mhz crystal is connected with8051, how much is the time taken for the count in timer
0 to get incremented by one?
3. What is the use of TCON register?
4. What is the use of TMOD register?
5. Mention the serial communication modes of 8051.
ADDITIONAL EXPERIMENTS
BEYOND THE SYLLABUS
EX NO: 41
PALINDROME CHECKING USING TASM
DATE:
AIM:
To write an assembly language program get the string from user and check the string is
palindrome or not using TASM.
ALGORITHM:
PROGRAM:
DISP MACRO
MSG LEA DX,
MSG MOV AH,
9H
INT
21H
ENDM
.MODEL SMALL
.STACK 100
.DATA
CR EQU
0DH LF
EQU 0AH
STRING DB 40 DUP
(?) RSTRING DB 40
DUP(?)
MSG DB CR, LF,’ ENTER THE STRING:$’
MSGR DB CR, LF, ‘REVERSE OF THE STRING:$’
MSGP DB CR, LF, ‘THE GIVEN STRING IS PALINDROME$’
MSGNP DB CR, LF, ‘THE GIVEN STRING IS NOT
PALINDROME$’ AGAIN DB CR, LF, ‘PRESS 1 TO TRY
AGAIN$’
THANKS DB 0AH, 10, 13, ‘THANKS FOR USING THIS PROGRAM$’, 13, 10,’$’
.CODE MAIN PROC
START: MOV AX, @DATA
MOV DS, AX
MOV ES, AX
DISP.MSG
LEA SI, STRING
CALL GETSTRING
NEXT: MOV AL,’$’
MOV [SI], AL
MOV BX,CX
LEA DI, RSTRING
CALL REVERSESTRING
MOV AL, ‘$’
MOV [DI], AL
DISP MSGR
DISP RSTRING
MOV CX, BX
LEA DI, STRING
LEA SI, STRING
REP CMPSB
JNE NOTPALINDROME
DISP MSGP
JMP EXIT
NOTPALINDROME:DISP
MSGNP
EXIT: DISP AGAIN
MOV AH,
01H INT
21H
CMP
AL,31H JE
START
DISP
THANKS
MOV AH,
4CH INT
21H MAIN
ENDP
GETSTRING
PROC READCHAR:MOV
AH,01H
INT 21H
CMP
AL,CR JE
NEXT
MOV [SI],
AL INC SI
INC CX
JMP READCHAR
RET
GETSTRING ENDP
REVERSESTRING
PROC
REVERSE:DEC SI 3128 ACT
MOV DL,
[SI] MOV
[DI], DL
INC DI
LOOP REVERSE
RET
REVERSESTRING
ENDP END
RESULT:
Thus an ALP to get the string from user and checked the given string is palindrome or not
using TASM.