EC8681 MPMC LabManual
EC8681 MPMC LabManual
Name :
Register Number :
Lab Name/Code :
Semester/Year :
1
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
2
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
INDEX
S.No Date Name of the Experiment Page Marks Initial of
No. Faculty
DESIGN AND TEST EXPERIMENTS
Average:
3
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.: 1
ADDITION AND SUBTRACTION OF TWO 16 BIT NUMBERS USING 8086
AIM:
To add and subtract two 16-Bit numbers stored at consecutive memory locations.
APPARATUS REQUIRED:
8086 kit
PROGRAM
4
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION:
Input Output
Address Data Address Data
2000 2004
ADDITION
2001 2005
2002 2006
2003
OBSERVATION:
Input Output
Address Data Address Data
2000 2004
SUBTRACTION
2001 2005
2002 2006
2003
5
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
SUBTRACTION
6
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
RESULT :
7
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.:
MULTIPLICATION AND DIVISION OF TWO 16 BIT NUMBERS USING 8086
AIM:
To write an assembly language program for the multiplication and division of two 16 bit numbers
using 8086 microprocessor kit
APPARATUS REQUIRED:
8086 kit
ALGORITHM: (16 BIT MULTIPLICATION)
PROGRAM:
MULTIPLICATION
8
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION:
Input Output
Address Data Address Data
1100 1104
MULTIPLICATION
1101 1105
1102 1106
1103 1107
OBSERVATION:
Input Output
Address Data Address Data
1100 1104
DIVISION
1101 1105
1102 1106
1103 1107
9
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM
DIVISION
RESULT:
10
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.:
LOGICAL OPERATION USING 8086
AIM:
To write an assembly language program for one’s complement and AND operation using 8086
microprocessor kit.
APPARATUS REQUIRED:
8086 kit
ALGORITHM:
1. Start the program.
2. Move the data to accumulator.
3. Give the instruction for ONES complement and AND operation.
4. Store the result in respective address.
5. Stop the program.
PROGRAM
ONES COMPLEMENT
11
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION:
ONES COMPLEMENT
INPUT OUTPUT
1400
1401
AND OPERATION
INPUT OUTPUT
1200 1400
1201 1401
12
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
AND OPERATION
RESULT:
13
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.: 2
AIM :
To write an Assembly Language Program (ALP) for moving a data block without overlap using 8086.
APPARATUS REQUIRED:
8086 kit
PROGRAM:
Address Label Opcode Mnemonics Operand Comments
14
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION
15
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
RESULT:
16
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.: 4
STRING OPERATIONS
AIM:
To perform string manipulation operations using 8086 string primitive.
APPARATUS REQUIRED:
8086 kit
THEORY:
The 8086 instruction set includes called the string primitives. Each string primitive instruction
performs a sequence of operations normally handled by an instruction loop. The string primitive
instruction performs an operation specified by the primitive, then increments or decrements the
pointer registers involved in the operation. On each iteration the affected pointer registers can be
either incremented or decremented by 1 or 2.
Pointer registers will be incremented if the value of the Direction Flag in the Flags Register is
0; affected pointer will be decremented if the value of the Direction Flag is 1. The affected pointer
registers will be incremented or decremented by 1 if the low-order bit of the string primitive
operation code is 0. If the low-order bit of the string primitive operation code is 1,the affected pointer
registers will be incremented or decremented by 2.
Use of index registers and string primitives along with direction flag status enables efficient
array and string manipulation as shall be evident from the following examples.
Since the 8086 includes the string primitives which require initialization of the index register
the SI and DI registers are initialized to start of the source and start of the destination array
respectively. The direction flag is cleared to facilitate auto-incrementing of the index registers. The
CX register is used to perform the operation repeatedly. The string primitive is used in MOVS. In the
case of MOVE operation, the status of the direction flag is however immaterial.
17
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM1:
PROGRAM 2:
Input [AL]
Output [2000]
18
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
EXAMPLE-1:
The data for the source array has to be initially entered. Hence let us fill the source locations starting
from 2000 using the FILL command in the kit. Fill locations from 2000 to 20FF with data XX.
PROGRAM-1 :
EXAMPLE-2:
This program uses the string primitive STOS. The function of this is that it will store the byte in AL
or the word in AX depending upon the operand size from the location pointed to by the destination
index DI. So if we want to fill a block with a particular data then we should set destination index to
the beginning of the block and then use the STOSW instruction or the STOSB instruction and use CX
to get the required length. S_ARRAY is the location 2000 in this program.
PROGRAM -2:
19
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM -3:
INPUT :
Input [AX]
OUTPUT :
Address Data
2000
2001
2002
2003
. .
20FE
20
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM 3 :
PROCEDURE:
RESULT:
21
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No. : 4
SORTING AN ARRAY USING 8086
AIM:
To write an assembly language program to sort an array of data in ascending and descending order
using 8086 microprocessor kit.
APPARATUS REQUIRED:
8086 kit
ALGORITHM:
PROGRAM
22
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION:
ASCENDING ORDER :
Input Output
1101 1101
1102 1102
1103 1103
1104 1104
1105 1105
23
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
24
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION:
DESCENDING ORDER :
Input Output
1101 1101
1102 1102
1103 1103
1104 1104
1105 1105
25
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM
RESULT :
26
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex. No.:
LARGEST & SMALLEST NUMBER IN AN ARRAY USING 8086
AIM:
To find the largest and smallest number in a given array using 8086 microprocessor.
APPARATUS REQUIRED:
8086 kit
PROGRAM
LARGEST NUMBER IN A DATA ARRAY:
Increment the
100A BACK 46 INC SI
address
Increment the
100B 46 INC SI
address
100C 3B 04 CMP AX,[SI] Compare contents
Check above or
100E 73 02 JAE GO
below
Content of 2000 mov
1010 8B 04 MOV AX,[SI]
to AX
1012 GO E2 F6 DEC CX Jump
Jump if CX is not
1013 75 F5 JNZ BACK
zero
Store the result in
1015 89 06 51 30 MOV [2051],AX
2051
1019 F4 HLT - Stop
27
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION
2003
2004
2005
2006
2007
2008
2009
200A
200B
200C
200D
Address Data
2051
2052
28
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM
SMALLEST NUMBER IN A DATA ARRAY:
29
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION
2003
2004
2005
2006
2007
2008
2009
200A
200B
200C
200D
Address Data
2051
2052
30
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
RESULT :
31
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.:
ARITHMETIC AND LOGICAL OPERATIONS USING MASM SOFTWARE
AIM:
To write ALP for Arithmetic and logic operations using MASAM.
SOFTWARE REQUIRED:
PROCEDURE :
1. Go to command prompt and type ‘edit’
2. In the edit window type the program.
3. Save the program as ‘add.asm’
4. Exit from edit window and in the command prompt following operations are performed:
D:/8086>masm add.asm (press enter)
D:/8086> link add.obj (press enter)
D:/8086> debug add.exe (press enter)
- e 2000 01 02 08 05 (press enter)
- g = 1000 (press enter)
Program terminated correctly
PROGRAM:
16-BIT ADDITION
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov cl,00h
Mov ax,[si]
Mov bx,[si+2]
32
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Add ax,bx
Addition:
Input:
-e 2000
Output:
-e 2004
33
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Jnc L1
Inc cl
L1: Mov [si+4], ax
Mov [si+6], cl
Mov ah,4ch
Int 21h
Code ends
End
16-BIT SUBTRACTION
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov cl,00h
Mov ax, [si]
Mov bx,[si+2]
Sub ax,bx
Jnc L1
Inc cl
Not ax
Add ax,0001h
L1: Mov [si+4], ax
Mov [si+6], cl
Mov ah,4ch
Int 21h
Code ends
End
34
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Subtraction:
Input:
-e 2000
Output:
-e 2004
35
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
16-BIT MULTIPLICATION
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov ax,[si]
Mov bx,[si+2]
Mul bx
Mov [si+4], ax
Mov [si+6], dx
Mov ah,4ch
Int 21h
Code ends
End
16-BIT DIVISION
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov ax,[si]
Mov bx,[si+2]
Div bx
Mov [si+4], ax
Mov [si+6], dx
Mov ah,4ch
Int 21h
Code ends
36
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
End
Multiplication:
Input :
-e 2000
Output:
-e 2004
Division:
Input :
-e 2000
Output:
-e 2004
-e 2006
Logical OR:
Output:
-e 2000
Logical AND:
Output:
-e 2000
37
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
LOGICAL AND:
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov al, 07h
Mov bl, 02h
And al, bl
Mov [si],al
Int 21h
Code ends
End
LOGICAL OR:
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov al, 07h
Mov bl, 02h
Or al, bl
Mov [si],al
Int 21h
Code ends
End
LOGICAL XOR:
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov al, 07h
Mov bl, 02h
Xor al, bl
Mov [si],al
Int 21h
Code ends
End
38
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Logical XOR:
Output:
-e 2000
Logical NOT:
Output:
-e 2000
39
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
NOT OPERATION:
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov Al, 07h
Not Al
Mov [si],Al
Int 21h
Code ends
End
RESULT:
40
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.
BIOS / DOS CALL - STRING MANIPULATION
AIM:
To perform string manipulation and BIOS / DOS call using MASM software.
APPARATUS REQUIRED:
PC loaded with MASM software.
PROCEDURE:
1. Go to command prompt and type ‘edit’
2. In the edit window type the program.
3. Save the program as ‘str.asm’
4. Exit from edit window and in the command prompt following operations are performed:
D:/8086> masm str.asm (press enter 3 times)
D:/8086> link str.obj (press enter 3 times)
D:/8086> debug str.exe (press enter)
- f 2000 20ff 45 (any data) (press enter)
- g = 1000 (press enter)
Program terminated correctly
PROGRAM :
Code segment
Assume CS : code, DS: code
Org 1000h
Mov si, 2000h
Mov cx, 00ffh
Mov di, 3000h
Move: movsb
Loop Move
Mov ah, 4ch
Int 21h
Code ends
End
41
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Output:
-e 3000 to 30FF
RESULT :
42
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.:
BIOS / DOS CALL – SEARCH AN ELEMENT
AIM :
To search an element in an array and BIOS / DOS call using MASM software.
APPARATUS REQUIRED:
PC loaded with MASM software.
PROCEDURE :
1. Go to command prompt and type ‘edit’
2. In the edit window type the program.
3. Save the program as ‘search.asm’
4. Exit from edit window and in the command prompt following operations are performed:
D:/8086>masm search.asm (press enter)
D:/8086> link search.obj (press enter)
D:/8086> debug search.exe (press enter)
- e 2000 01 02 08 05 08 (press enter)
- g = 1000 (press enter)
Program terminated correctly
PROGRAM:
Code segment
Assume CS:code, DS: code
Org 1000h
Mov di, 2100h
Mov bx, 2000h
Mov dh, 05h (No. of elements in the array)
Mov ch, 08h (Data which needs to be searched)
Mov cl,00h
43
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Output:
-e 2100
44
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
RESULT :
45
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No :7
TRAFFIC LIGHT CONTROLLER USING 8086
AIM:
APPARATUS REQUIRED:
THEORY:
Traffic light control using microcontroller 8051 can be done easily with parallel ports. The port pins
can be connected to each light, LED, or group of LEDs through a proper driver circuit. The data in
parallel ports can be changed using the program, for turning on and off the lights. The port pins of
Port A and Port B are used. The least significant three bits of Port A are used for the west direction.
The Port A pins 3,4,5 are used for are used for the north direction. Similarly, the least significant bits
of Port B are used for the lights in east direction and pins 3,4,5 are used for the south direction.
PROGRAM
Address Label Opcode Mnemonics
1000 START: C7 C6 00 12 MOV SI, 1200H
1017 46 INC SI
46
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
47
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
48
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Sequence SG SY SR EG EY ER NG NY NR WG WY WR PA PB
PB.5 PB.4 PB.3 PB.2 PB.1 PB.0 PA.5 PA.4 PA.3 PA.2 PA.1 PA.0 Data Data
Sequence 0 0 1 0 0 1 0 0 1 1 0 0 0CH 09H
1
0 0 1 0 0 1 0 1 0 1 0 0 14H 09H
Sequence 0 0 1 0 0 1 1 0 0 0 0 1 21H 09H
2
0 0 1 0 1 0 1 0 0 0 0 1 21H 0AH
Sequence 0 0 1 1 0 0 0 0 1 0 0 1 09H 0CH
3
0 1 0 1 0 0 0 0 1 0 0 1 09H 14H
Sequence 1 0 0 0 0 0 0 1 1 0 0 1 09H 21H
4
1 0 0 0 0 1 0 0 1 0 1 0 0AH 21H
Port B 1 0 0 0 0 0 0 1 81H
Port C 1 0 0 0 0 0 1 0 82H
Control Word
49
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
1159 90 NOP
115A 90 NOP
115B 90 NOP
115C 75 FA JNZ $
115E 4A DEC DX
115F 75 F3 JNZ @
1161 C3 RET
LOOK UP TABLE
Address Opcode
1200 80H
1201 0CH,09H,14H,09H (WEST WAY)
1205 21H,09H,21H,0AH (NORTH WAY)
1209 09H,0CH,09H,14H (EAST WAY)
120D 09H,21H,0AH,21H ( SOUTH WAY)
RESULT:
50
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No. : 8
STEPPER MOTOR INTERFACING WITH 8086
AIM:
THEORY:
A motor in which the rotor is able to assume only discrete stationary angular position is a
stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium position to the
next. Stepper Motors are used very wisely in position control systems like printers, disk drives,
process control machine tools, etc.
The basic two-phase stepper motor consists of two pairs of stator poles. Each of the four poles
has its own winding. The excitation of any one winding generates a North Pole. A South Pole gets
induced at the diametrically opposite side. The rotor magnetic system has two end faces. It is a
permanent magnet with one face as South Pole and the other as North Pole.
The Stepper Motor windings A1, A2, B1, B2 are cyclically excited with a DC current to run
the motor in clockwise direction. By reversing the phase sequence as A1, B2, A2, B1, anticlockwise
stepping can be obtained.
2-PHASE SWITCHING SCHEME:
In this scheme, any two adjacent stator windings are energized. The switching scheme is
shown in the table. This scheme produces more torque.
The 74138 chip is used for generating the address decoding logic to generate the device select
pulses; CS1 & CS2 for selecting the IC 74175.The 74175 latches the data bus to the stepper motor
driving circuitry.
51
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Anticlockwise Clockwise
STEP A1 A2 B1 B2 DATA STEP A1 A2 B1 B2 DATA
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
52
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Stepper Motor requires logic signals of relatively high power. Therefore, the interface
circuitry that generates the driving pulses uses silicon Darlington pair transistors. The inputs for the
interface circuit are TTL pulses generated under software control using the Microcontroller Kit. The
TTL level of pulse sequence from the data bus is translated to high voltage output pulses using a
buffer 7407 with open collector.
PROCEDURE:
Enter the above program starting from location 1018.and execute the same. The stepper motor
rotates. Varying the count at R4 and R5 can vary the speed. Entering the data in the look-up TABLE
in the reverse order can vary direction of rotation.
PROGRAM:
53
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Data Data
Address
(Clockwise Rotation ) (Anti- Clockwise Rotation )
1018 09 0A
1019 05 06
101A 06 05
101B 0A 09
54
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
RESULT:
55
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No :
INTERFACING 8279 WITH 8086
AIM:
To display Rolling message in display using 8279 programmable keyboard/display controller by interfacing
it with 8086.
APPARATUS REQUIRED:
S.No Apparatus Quantity
1 Microprocessor kit-8086 1
2 Keyboard display Interface-8279 1
3 Connecting cable -
DESCRIPTION:
The INTEL 8279 is specially developed for interfacing keyboard and display devices to
8085/8086/8088 microprocessor based system.
The important features of 8279 are,
• Simultaneous keyboard and display operations.
• Scanned keyboard mode.
• Scanned sensor mode.
• 8-character keyboard FIFO.
• 16-character display.
• Right or left entry 1 6-byte display RAM.
• Programmable scan timing.
DISPLAY SECTION:
• The display section has eight output lines divided into two groups A0-A3 and B0-B3.
• The output lines can be used either as a single group of eight lines or as two groups of our lines, in
conjunction with the scan lines for a multiplexed display.
• The output lines are connected to the anodes through driver transistor in case of common cathode 7-
segment LEDs.
• The cathodes are connected to scan lines through driver transistors.
56
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
0 0 0 D D K K K
0 0 0 1 0 0 0 0
1 1 0 0 1 1 0 0
1 0 0 AI A A A A
1 0 0 1 0 0 0 0
H 1 0 0 1 1 0 0 0 98
E 0 1 1 0 1 0 0 0 68
L 0 1 1 1 1 1 0 0 7C
P 1 1 0 0 1 0 0 0 C8
U 0 0 0 1 1 1 0 0 1C
S 0 0 1 0 1 0 0 1 29
57
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
ALGORITHM :
1. Store the look up table which contains the common anode seven segment code for the
message ‘HELP US’ from memory location 1200.
2. Load the number of characters to be displayed in CX reg.
3. Move display mode set up command to acc. And then load it in command reg.
4. Move clear command to acc. and then load it in command reg.
5. Move display RAM command to acc. And then load it in command reg.
6. Then move common anode seven segment codes one by one for the character to be displayed
to accumulator from memory and then load it in data reg.
7. Call delay subroutine between each code.
8. Repeat step 2 to 7 to get continuous display of message ‘HELP US’.
PROGRAM -1 :
58
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
59
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM – 2 :
ROLLING DISPLAY:
LOOK UP TABLE:
1200 FF FF FF FF
1204 FF FF FF FF
1208 98 68 7C C8
120C FF 1C 29 FF
RESULT:
60
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
S2 S1 EP PEN L2 L1 B2 B1
E 1 0 0 1 1 1 0
0 0 1 1 0 1 1 1
EH: Enter Hunt mode (No effect in Async.) SBRK: Send Break Character
IR: Internal Reset RxE : Receive Enable
RTS : Request To Send DTR : Data Terminal Ready
ER : Error Reset TxEN : Transmit Enable
61
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No.:
INTERFACING 8251 WITH 8086
AIM:
APPARATUS REQUIRED:
3 Connecting cable -
DESCRIPTION:
USART-INTEL 8251A:
1. The 8251A is a programmable serial communication interface chip designed for synchronous
and asynchronous serial data communication.
2. It supports the serial transmission of data.
3. It is packed in a 28 pin DIP.
ALGORITHM :
1. Clock for serial transmission and reception is generated using Intel’s Programmable Interval
Timer 8254, which is made to function in mode 3 (Square wave generator). For that first the
control word for 8254 (36H) is loaded in its control register. Then count value (0AH) is
loaded in counter 0’s count register.
2. Mode instruction word for 8251 (4EH) is loaded in its control register.
3. Then command instruction word (37H) is loaded in control register.
4. Data to be transmitted is loaded in 8251’s data register.
5. In program 2 get the data in data register to check whether the data is received at the
receiver side properly.
6. Store the received data in accumulator in memory Location 1250.
62
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address
Data
63
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM (TX):
PROGRAM (RX):
1200 E4 C0 IN AL,C0
1202 BB 50 12 MOV BX,1250
1205 88 07 MOV [BX],AL
1207 F4 HLT -
RESULT:
64
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
65
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No. :
INTERFACING 8255 WITH 8086
AIM:
To interface programmable peripheral interface 8255 with 8085 and study its characteristics in
mode 0.
APPARATUS REQUIRED:
The 8255 Programmable Peripheral Interface (PPI) is a very popular and versatile input /
output chip that are easily configured to function in several different configurations. This chip
allows to do both digital input and output (DIO) with PC. The functional configuration of the
8255A is programmed by the systems software so that normally no external logic is necessary to
interface peripheral devices or structures. There are 3-stable bi-directional 8-bit buffer is used to
interface the 8255A to the systems data bus. Data is transmitted or received by the buffer upon
execution of input or output instructions by the CPU. Read/Write and Control Logic block
manages all the Internal and External transfers of both Data and Control or Status words.
I/O MODES:
66
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
I/O MODES:
Control Word:
67
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM :
To initialize port A as an input port in Mode -0 and to input the data set by the SPDT switches
through port A, output the same to LEDs connected to Port B and store the data at RAM location
1100.
68
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OBSERVATION
MODE -0
OUTPUT :
PORT B – LED Condition:
Memory Address: 1100
Data:
MODE -1
OUTPUT:
PORT B – LED Condition:
MODE - 2
OUTPUT:
PORT B – LED Condition:
69
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM :
PROGRAM :
RESULT:
70
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address Data
(Data 1)
Input -
(Data 2)
71
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No. :
AIM:
APPARATUS REQUIRED:
Microcontroller kit-8051
ALGORITHM: ADDITION
Comments
Address Label Opcode Mnemonics Operand
4100 E4 CLR A Clear A register
72
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT
Address Data
-
(data 1)
Input
(data 2)
73
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
ALGORITHM: SUBTRACTION
PROGRAM:
74
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address Data
(data1)
Input -
(data2)
75
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
ALGORITHM: MULTIPLICATION
76
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address Data
- (data 1)
Input
(data 2)
4500H (Quotient)
77
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
ALGORITHM: DIVISION
PROGRAM:
RESULT:
78
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address Data
- (data)
Input
(data)
79
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
Date :
Ex.No. :
LOGICAL AND & OR OPERATIONS USING 8051
AIM:
To write an assembly language program for logical operations using 8051 microprocessor.
APPARATUS REQUIRED:
Microcontroller kit-8051
ALGORITHM:
PROGRAM:
LOGICAL OR OPERATION
Opcode
Address Label Mnemonics Operand Comments
5000 E4 CLR A Clear A register
80
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
OUTPUT:
Address Data
-
Data 1:
Input
Data 2:
Output 4150H
81
EC8681 Microprocessor and Microcontroller Laboratory SSCET/ECE
PROGRAM:
LOGICAL AND OPERATION
Opcode
Address Label Mnemonics Operand Comments
4100 74 MOV A, #data1 Move data1 to A register
RESULT:
82