EC8681-MPMC-Lab Manual
EC8681-MPMC-Lab Manual
Engineering
2022-23
Name :
Register Number :
Lab Name/Code :
Semester/Year :
1
DEPARTMENT OF ELECTRONICS AND
COMMUNICATION ENGINEERING
BONAFIDE CERTIFICATE
Register No.:
2
INDEX
Average:
3
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
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
ALGORITHM: (16 bit Subtraction)
SUBTRACTION
6
RESULT :
7
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
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
ALGORITHM: (16 BIT DIVISION)
PROGRAM
DIVISION
RESULT:
10
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
OBSERVATION:
ONES COMPLEMENT
INPUT OUTPUT
1400
1401
AND OPERATION
INPUT OUTPUT
1200 1400
1201 1401
12
AND OPERATION
RESULT:
13
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
OBSERVATION
15
RESULT:
16
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
PROGRAM1:
PROGRAM 2:
Input [AL]
Output [2000]
18
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
PROGRAM -3:
INPUT :
Input [AX]
OUTPUT :
Address Data
2000
2001
2002
2003
. .
20FE
20
PROGRAM 3 :
PROCEDURE:
RESULT:
21
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
OBSERVATION:
ASCENDING ORDER :
Input Output
1101 1101
1102 1102
1103 1103
1104 1104
1105 1105
23
1010 46 INC SI Increment SI
24
OBSERVATION:
DESCENDING ORDER :
Input Output
1101 1101
1102 1102
1103 1103
1104 1104
1105 1105
25
PROGRAM
Address Label Opcode Mnemonics Operand Comments
MOV Set SI register as pointer for
1000 C7 C6 00 11 SI,1100 array
Set CL as count for N-1
1004 8A 0C MOV CL,[SI] repetitions
1006 FE C9 DEC CL Decrement CL
RESULT :
26
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
OBSERVATION
2003
2004
2005
2006
2007
2008
2009
200A
200B
200C
200D
Address Data
2051
2052
28
PROGRAM
SMALLEST NUMBER IN A DATA ARRAY:
29
OBSERVATION
2003
2004
2005
2006
2007
2008
2009
200A
200B
200C
200D
Address Data
2051
2052
30
RESULT :
31
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
Add ax,bx
Addition:
Input:
-e 2000
Output:
-e 2004
33
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
Subtraction:
Input:
-e 2000
Output:
-e 2004
35
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
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
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
Logical XOR:
Output:
-e 2000
Logical NOT:
Output:
-e 2000
39
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
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
Output:
-e 3000 to 30FF
RESULT :
42
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
Output:
-e 2100
44
L2: mov ax,[bx]
Cmp al, ch
Jnz L1
Inc cl
L1: inc bx
Dec dh
Jnz L2
Mov [di], cl
Mov ah,4ch
Int 21h
Code ends
End
RESULT :
45
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
100F 46 INC SI
1017 46 INC SI
46
47
101E EE OUT DX,AL
101F E8 DE 00 CALL DELAY 1
1022 46 INC SI
1023 8A 04 MOV AL,[SI]
1025 C7 C2 80 00 MOV DX,0080H
1029 EE OUT DX,AL
102A 46 INC SI
102B 8A 04 MOV AL,[SI]
102D C7 C2 81 00 MOV DX,0081H
1031 EE OUT DX,AL
1032 E8 1B 01 CALL DELAY 2
1035 46 INC SI
1036 49 DEC CX
1037 75 D7 JNZ NEXT
1039 E9 C4 FF JMP START
1100 DELAY 1: C7 C2 14 00 MOV DX,0014H
1104 % C7 C3 FF FF MOV BX,FFFF
1108 # 90 NOP
1109 90 NOP
111A 90 NOP
111B 90 NOP
110C 4B DEC BX
110D 75 F9 JNZ #
110F 4A DEC DX
1110 75 F2 JNZ %
1112 C3 RET
1150 DELAY 2: C7 C2 05 00 MOV DX,0005H
1154 @ C7 C3 FF FF MOV BX,FFFF
1158 $ 90 NOP
48
Data for port pins for traffic light control
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
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
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
Switching scheme of stepper motor :
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
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
Stepper motor Stepping Sequence Look up table :
Data Data
Address
(Clockwise Rotation ) (Anti- Clockwise Rotation )
1018 09 0A
1019 05 06
101A 06 05
101B 0A 09
54
Increment the DI value
1012 INC DI to point out to the next
value
1013 LOOP # (1007) Repeat the process
Jump to starting address
1015 JMP 1000 and continue the
processs
RESULT:
55
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
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,
1. Simultaneous keyboard and display operations.
2. Scanned keyboard mode.
3. Scanned sensor mode.
4. 8-character keyboard FIFO.
5. 16-character display.
6. Right or left entry 1 6-byte display RAM.
7. 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
Display mode setup command: [10]
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
The display can be blanked by BD (low) line.
The display section consists of 16 x 8 display RAM. The CPU can read from or write into any
location of the display RAM.
In common anode type seven segment display, 0 is used for a segment to glow and 1 for a
segment to remain in off condition.
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
OUTPUT:
59
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
Mode Instruction Word Format: (4Eh)
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
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
OUTPUT:
Address
Data
63
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
65
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
I/O MODES:
Control Word:
67
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
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
PROGRAM :
Address Opcode Mnemonics Operand Comments
Initialize port A as Input
1000 B0 90 MOV AL, 84 port in mode 0.
1002 E6 C6 OUT C6,AL Send Mode Control word
PROGRAM :
Address Opcodes Mnemonics Operand Comments
Initialize port A as Input port
1000 B0 90 MOV AL, C0 in mode 0.
1002 E6 C6 OUT C6,AL Send Mode Control word
RESULT:
70
FLOW CHART: ADDTION
OUTPUT:
Address Data
(Data 1)
Input -
(Data 2)
71
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
FLOW CHART: SUBTRACTION
OUTPUT
Address Data
-
(data 1)
Input
(data 2)
73
ALGORITHM: SUBTRACTION
PROGRAM:
74
FLOW CHART: MULTIPLICATION
OUTPUT:
Address Data
(data1)
Input -
(data2)
75
ALGORITHM: MULTIPLICATION
76
FLOW CHART: DIVISION
OUTPUT:
Address Data
- (data 1)
Input
(data 2)
4500H (Quotient)
77
ALGORITHM: DIVISION
PROGRAM:
RESULT:
78
FLOW CHART: LOGICAL OR
OUTPUT:
Address Data
- (data)
Input
(data)
79
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
FLOW CHART: LOGICAL AND OPERATION
OUTPUT:
Address Data
-
Data 1:
Input
Data 2:
Output 4150H
81
PROGRAM:
LOGICAL AND OPERATION
Opcode
Address Label Mnemonics Operand Comments
4100 74 MOV A, #data1 Move data1 to A register
RESULT:
82