MP Lab-2017-With Output

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 76

BETHLAHEM INSTITUTE OF ENGINEERING

KARUNGAL

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

LABORATORY MANUAL

MICROPROCESSOR AND MICROCONTROLLER


LABORATORY
Lab Code: EC 8681

Class:VI Semester

Branch: COMPUTER SCIENCE AND ENGINEERING /


INFORMATION TECHNOLOGY

NAME :
ROLL NO :
YEAR/SEM :

Faculty-In-Charge: C.M.Edwin Thurai , AP/ECE


INDEX
EXPT.NO DATE EXPERIMENT NAME MARKS SIGNATURE

8086 Programs using kits

1 Basic arithmetic operations

2 Basic Logical operations

3 Sorting

4 Searching

5 String Manipulation

6 Matrix operations

Peripherals and Interfacing Experiments

7 Traffic light control

8 Stepper motor control

9 Key board and Display Interface

10 A/D Interface

11 D/A Interface and Waveform Generation

12 Programmable Interrupt Controller Interface

13 Programmable Interval Timer Interface

8051 Experiments using kits

14 Basic arithmetic operations

15 Basic Logical operations

16 Square and Cube program

8086 Programs using MASM

17 Basic arithmetic and Logical operations


PROGRAMMING USING 8086 MICROPROCESSOR

ARITHMETIC OPERATIONS

Expt. No:

Date :

AIM:

To perform 16 bit Arithmetic operation such as addition, subtraction, multiplication, division


using 8086 Microprocessor Kit.
APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity

1. MICROPROCESSOR MICRO 86/88 KIT 1


2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

THEORY:

The ADD instruction requires either the addend or the augend to be in a register, unless the
source operand is immediate since the addressing modes permitted for the source and destination are
register-register, memory-register, register -memory, register-immediate, and finally memory
immediate. Using the add instruction, 16 bit addition is performed. The next arithmetic primitive is
SUB which is used to perform subtraction. It permits the same modes of addressing as ADD.
Unlike most of the 8 bit processors which do not have an arithmetic multiply instruction, 16
bit processors from 8086 upward provide both signed and unsigned multiply in their instruction sets
to overcome the loss of efficiency in performing repeated addition. The MUL instruction can have
both 16 and 8 bit operands and the multiplicand is AX or AL, accordingly the result for a byte multiply
is a 16 bit number in AX while that for a word multiply is a 32 bit number, the lower word of which
is in AX and the higher word in DX.
Using the DIV instruction of 8086, both division of a double word by a word and a word by
a byte can be performed. For the first case, the lower order word of the dividend is in AX and the
higher order word is in DX. The quotient is in AX and remainder in DX. For the second case, the
dividend is in AL, the quotient is in AL and the remainder in AH.
1. PROGRAM FOR ADDITION

Memory address Opcode Mnemonics Comments


1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004 Add accumulator content with the
1005 data in the memory location
ADD AX,[1102]
1006 1102.The result will be stored in
1007 the accumulator AX
1008
1009 Store the data byte from AX in to
MOV[1200],AX
100A the memory location 1200
100B
100C HLT Terminate the program

2. PROGRAM FOR SUBTRACTION

Memory
Opcode Mnemonics Comments
address
1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004 Subtract accumulator content with
1005 the data in the memory location
SUB AX,[1102]
1006 1102.The result will be stored in
1007 the accumulator AX
1008
1009 Store the data byte from AX in to
MOV[1200],AX
100A the memory location 1200
100B
100C HLT Terminate the program
FLOW CHART FOR ADDITION

START

GET OPERANDS

DIVIDE
ADD

STORE RESULT

STOP

OUTPUT FOR ADDITION

INPUT ADDRESS DATA


1100 24 23
1102 12 21
OUTPUT ADDRESS DATA
1200 36 44
FLOW CHART FOR SUBTRACTION

START

GET OPERANDS

SUBTRACT
DIVIDE

STORE RESULT

STOP

OUTPUT FOR SUBTRACTION

INPUT ADDRESS DATA


1100 13 14
1102 02 04
OUTPUT ADDRESS DATA
1200 11 10
FLOW CHART FOR MUTIPLICATION

START

GET OPERANDS

MULTIPLY
DIVIDE

STORE RESULT

STOP

OUTPUT FOR MUTIPLICATION

INPUT ADDRESS DATA


1100 14 15
1102 12 11
OUTPUT ADDRESS DATA
1200 01 6A
1202 CF 65
FLOW CHART FOR DIVISION

START

GET OPERANDS

DIVIDE

STORE RESULT

STOP

OUTPUT FOR DIVISION

INPUT ADDRESS DATA


1100 14 15
1102 12 11
OUTPUT ADDRESS DATA
1200 02 04
1202 00 01
3. PROGRAM FOR MUTIPLICATION
Memory Opcode Mnemonics Comments
address
1000
1001 Load the data in to AX register from
MOV AX,[1100]
1002 the memory location1100.
1003
1004
1005 Load the data in to BX register from
1006 MOV BX,[1102]
the memory location 1102
1007
1008 Multiply the accumulator content
MUL BX
1009 with BX register
100A
100B Move the DX content to location
MOV [1200],DX
100C 1200
100D
100E
100F Move the AX content to location
MOV [1202],AX
1010 1202.
1011
1012 HLT Terminate the program

4. PROGRAM FOR DIVISION


Memory
Opcodes Mnemonics Comments
address
1000
1001 Load the data in to AX register from
MOV AX,[1100]
1002 the memory location1100.
1003
1004
1005 Load the data in to CX register from
1006 MOV CX,[1102]
the memory location 1102
1007
1008 Divide AX content by CX and the
DIV CX
1009 result will be stored in DX and AX
100A
100B Move the AX content to the
MOV [1200],DX
100C memory location 1200
100D
100E
100F
MOV [1202],AX Move the DX content to 1202.
1010
1011
1012 HLT Terminate the program
PROCEDURE:
1. Enter the Mnemonics starting from the RAM address1000 by using (A command).
2. Enter the two input data in the location 1100 and 1102 using (SB command)
3. Execute the program with the command (GO starting address).
4. Check the corresponding result in the location 1200 and 1201
5. Change the data in the location 1100and 1102 and verify the result

RESULT:

Thus the assembly language program for 16-bit addition, subtraction, multiplication and
division was executed using 8086 and the output was verified.
8086 LOGICAL OPERATIONS

Expt. No.:

Date:

AIM:

To write an assembly language program to perform an AND, OR, XOR and NOT

operations using 8086 microprocessor kit.

APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity

1. MICROPROCESSOR MICRO 86/88 KIT 1


2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

1. PROGRAM FOR 16 BIT AND OPERATION


Memory address Opcode Mnemonics Comments
1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004
Load the data into 16 bit register
1005
MOV BX, [1102] BX from the memory location
1006
1102
1007
1008
Contents of BX is AND with AX
1009
AND AX,BX register and the result will be
100A
stored in the accumulator AX
100B
100C
100D Store the data byte from AX in to
MOV[1200],AX
100E the memory location 1200
100F
1010 HLT Terminate the program
PROGRAM FOR 16 BIT OR OPERATION
Memory address Opcode Mnemonics Comments
1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004
Load the data into 16 bit register
1005
MOV BX, [1102] BX from the memory location
1006
1102
1007
1008
Contents of BX is OR with AX
1009
OR AX,BX register and the result will be
100A
stored in the accumulator AX
100B
100C
100D Store the data byte from AX in to
MOV[1200],AX
100E the memory location 1200
100F
1010 HLT Terminate the program

PROGRAM FOR 16 BIT NOT OPERATION


Memory address Opcode Mnemonics Comments
1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004
Contents of AX is complemented
1005
NOT AX with NOT operation and the result
1006
is in the accumulator AX
1007
1008
1009 Store the data byte from AX in to
MOV[1200],AX
100A the memory location 1200
100B
1010 HLT Terminate the program
PROGRAM FOR 16 BIT XOR OPERATION
Memory address Opcode Mnemonics Comments
1000
Load the data into 16 bit register
1001
MOV AX, [1100] AX from the memory location
1002
1100
1003
1004
Load the data into 16 bit register
1005
MOV BX, [1102] BX from the memory location
1006
1102
1007
1008
Contents of BX is XOR with AX
1009
XOR AX,BX register and the result will be
100A
stored in the accumulator AX
100B
100C
100D Store the data byte from AX in to
MOV[1200],AX
100E the memory location 1200
100F
1010 HLT Terminate the program

PROCEDURE:
1. Enter the Mnemonics starting from the RAM address1000 by using (A command).
2. Enter the two input data in the location 1100 and 1102 using (SB command)
3. Execute the program with the command (GO starting address).
4. Check the corresponding result in the location 1200 and 1201
5. Change the data in the location 1100and 1102 and verify the result
FLOW CHART FOR AND OPERATION

START

GET OPERANDS

AND OPERATION
DIVIDE

STORE RESULT

STOP

OUTPUT FOR AND OPERATION


INPUT ADDRESS DATA
1100 11 02
1102 11 01
OUTPUT ADDRESS DATA
1200 11 00
FLOW CHART FOR OR OPERATION

START

GET OPERANDS

OR OPERATION
DIVIDE

STORE RESULT

STOP

FLOW CHART FOR OR OPERATION


INPUT ADDRESS DATA
1100 13 12
1102 21 31
OUTPUT ADDRESS DATA
1200 33 33
FLOW CHART FOR NOT OPERATION

START

GET OPERANDS

NOT OPERATION
DIVIDE

STORE RESULT

STOP

OUTPUT FOR NOT OPERATION

INPUT ADDRESS DATA


1100 13 12
OUTPUT ADDRESS DATA
1200 EC ED
FLOW CHART FOR XOR OPERATION

START

GET OPERANDS

XOR OPERATION
DIVIDE

STORE RESULT

STOP

OUTPUT FOR XOR OPERATION

INPUT ADDRESS DATA


1100 13 12
1102 21 31
OUTPUT ADDRESS DATA
1200 32 23

RESULT:

Thus the assembly language program for 16-bit Logical operations was executed using 8086.

SORTING
Expt. No.:

Date:

AIM:
To write an Assembly Language Program to sort numbers in ascending and descending order
using 8086.

APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity


1. MICROPROCESSOR MICRO 86/88 KIT 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

PROCEDURE:

1. Enter the mnemonics in the address specified.


2. Enter the input data.
3. Execute the program and check the result in the respective locations.
4. Change the input and check the result for different data.
FLOW CHART FOR SORTING (ASCENDING ORDER)

START

DX <- 0005

DX <- DX-1

CX <- DX

SI <- 1200

AL <- 1200

Compare AL with SI+01


NO
IF
CF=1 YES
BL <-[SI+01]

[SI+02] <- AX

[SI] <- BL

SI <-SI+1

LOOP 100B

DX <- DX-1

NO
IF
ZF=0
YES

STOP
PROGRAM FOR SORTING IN ASCENDING ORDER

Memory
Opcode Label Mnemonics Comments
Address
1000
1001 Initialize array size
MOV DX,0005
1002
1003
1004 DEC DX Decrement DX
1005
N1 MOV CX, DX Move the content of DX to CX
1006
1007
Initialize memory location to get
1008
MOV SI, 1200 data
1009
100A
100B Get the first data in AL
N2 MOV AL,[SI]
100C
100D Compare data in AL with the
100E CMP [SI+01] second data
100F
1010
JNC N3 Jump at no carry
1011
1012
Store the smallest data
1013 MOV BL,[SI+01]
1014
1015
1016 MOV[SI+01], AL Move the content of AL SI+01
1017
1018 Store data in memory location
MOV [SI],BL
1019
Go to next memory location
101A N3 INC SI
101B
LOOP N2 Loop
101C
Decrement the count
101D DEC DX
101E
JNZ NI Jump if non zero
101F
1020 HLT Terminate the program
OUTPUT : (Ascending order)

INPUT ADDRESS DATA

1200 12
1201 09
1202 07
1203 17
1204 13

OUTPUT ADDRESS DATA


1200 07
1201 09
1202 12
1203 13
1204 17
FLOW CHART FOR SORTING(DESCENDING ORDER)

START

DX <- 0005

DX <- DX-1

CX <- DX

SI <- 1200

AL <- 1200

Compare AL with SI+01


NO
IF
CF=0
YES
BL <-[SI+01]

[SI+02] <- AX

[SI] <- BL

SI <-SI+1

LOOP 100B

DX <- DX-1

NO
IF
ZF=0
YES

STOP
PROGRAM FOR SORTING IN DESCENDING ORDER

Memory
Opcodes Label Mnemonics Comments
Address
1000
1001 Initialize array size
MOV DX,0005
1002
1003
1004 DEC DX Decrement DX
1005 Move the content of DX
N1 MOV CX, DX
1006 to CX
1007
Initialize memory
1008
MOV SI, 1200 location to get data
1009
100A
100B Get the first data in AL
N2 MOV AL,[SI]
100C
100D Compare data in AL
100E CMP [SI+01] with the second data
100F
1010
JC N3 Jump at no carry
1011
1012
Store the largest data
1013 MOV BL,[SI+01]
1014
1015
Move the content of AL
1016 MOV [SI+01],AL
SI+01
1017
Store data in memory
1018
MOV [SI],BL location
1019
Go to next memory
101A N3 INC SI location

101B
LOOP N2 Loop
101C
Decrement the count
101D DEC DX
101E
JNZ NI Jump if non zero
101F
1020 HLT Terminate the program
OUTPUT (Descending order)

INPUT ADDRESS DATA

1200 12
1201 09
1202 07
1203 17
1204 13

OUTPUT ADDRESS DATA


1200 17
1201 13
1202 12
1203 09
1204 07

RESULT:
Thus the Assembly Language Program for sorting numbers in Ascending and Descending
order was executed using 8086 and the output was verified.
SEARCHING

Expt. No.:

Date:

AIM:

To write an Assembly Language Program for searching smallest and biggest numbers using 8086.

APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity

1. MICROPROCESSOR MICRO 86/88 KIT 1

2. POWER CHORD +5V SUPLLY 1

3. KEY BOARD 1

PROCEDURE:

1. Enter the mnemonics in the address specified.


2. Enter the input data.
3. Execute the program and check the result in the respective locations.
4. Change the input and check the result for different data.
FLOW CHART FOR SEARCHING THE BIGGEST NUMBER

START

MOVE COUNT TO CX

BX [1200]

AX 0000

Compare BX with AX

NO
IF
CF=0

YES

AX B(X)

BX BX+1

LOOP

1300 AX

STOP
FLOW CHART FOR SEARCHING THE SMALLEST NUMBER

START

MOVE COUNT TO CX

BX [1200]

AX 0000

Compare BX with AX

NO
IF
CF=1

YES

AX B(X)

BX BX+1

LOOP

1300 AX

STOP
PROGRAM FOR SEARCHING THE BIGGEST NUMBER

Memory
Opcodes Label Mnemonics Comments
Address
1000
1001 Move the content of 0004
MOV CX,0004
1002 to CX
1003
1004
1005 Move the content of 1200
MOV BX,1200
1006 to BX
1007
1008
Move the content of 0000
1009 MOV AL,0000
to AL
100A
100B
LABEL CMP AL,[BX] Compare AL and BX
100C
100D
JNB LOOP Jump if no carry
100E
100F Move the content of BX
MOV AL,[BX]
1010 to AL
1011 LOOP INC BX Increment BX by 1
1012
LOOP LABEL Loop
1013
1014
1015 Move the content of AL
MOV [1300],AL
1016 to 1300
1017
1018 HLT Terminate the program

OUTPUT ( SEARCHING THE BIGGEST NUMBER):

Input Address Input Data


1200 34
1201 23
1202 21
1203 04

Output Address Output Data


1300 34
PROGRAM FOR SEARCHING THE SMALLEST NUMBER

Memory
Opcodes Label Mnemonics Comments
Address
1000
1001 Move the content of 0004
MOV CX,0004
1002 to CX
1003
1004
1005 Move the content of 1200
MOV BX,1200
1006 to BX
1007
1008
Move the content of
1009
MOV AX,0FFF 0FFF to AX, Initialize the
100A
accumulator
100B
100C
LABEL CMP AL,[BX] Compare AL and BX
100D
100E
JB LOOP Jump if carry
100F
1010 Move the content of BX
MOV AX,[BX]
1011 to AL
1012 LOOP INC BX Increment BX by 1
1013
LOOP LABEL Loop
1014
1015
1016 Move the content of AL
MOV [4000],AX
1017 to 1300
1018
1019 HLT Terminate the program

OUTPUT: ( SEARCHING THE SMALLEST NUMBER)

Input Address Input Data


1200 76
1201 45
1202 09
1203 12

Output Address Output Data


4000 09

RESULT:
Thus the Assembly Language Program for performing searching the biggest and smallest
numbers was executed using 8086 and the output was verified.
STRING MANIPULATION

Expt. No.:

Date :

AIM:
To write assembly language program for string manipulation using 8086.

APPARATUS REQUIRED

Sl.No Required Components Specification Quantity


1. Microprocessor Micro 8086 Kit 1
2. Power Chord +5v Supply 1
3. Key Board 1

1. PROGRAM USING MOV SB:

Memory
Opcode Mnemonics Comments
Address

1000

1001 Initialize destination address


MOV SI,2000
1002
1003

1004

1005
MOV DI,2100 Initialize starting address
1006

1007

1008

1009
MOV CX, 00FF Initialize array size
100A

100B

100C CLD Clear direction flag

100D MOVE:MOVSB Copy the contents of source into


destination until count reaches zero

100E
LOOP MOVE Execute loop
100F

1010 HLT Terminate the program

PROCEDURE:

1. Enter the program from location 1000.


2. Fill FF locations as stated above with a particular data.
3. Execute the program. Check if the contents are duplicated to another 255 locations
using the compare command in the kit.

OUTPUT
Input Address Input Data
2000 05
2001 11
2002 12
2003 32
2004 03

Output Address Input Data


2100 05
2101 11
2102 12
2103 32
2104 03
PROGRAM USING STOSB:

Memory
Opcode Mnemonics Comments
Address

1000

1001
MOV CX,0100 Move 0100 to SI
1002

1003

1004

1005
MOV DI,1100 Move 1100 to DI
1006

1007

1008

1009
MOV AX, 0034 Move 0034 to AX
100A

100B

100C CLD Clear direction flag

100D L: STOSW Store the String

100E
LOOP L Execute loop
100F

1010 HLT Terminate the program

PROCEDURE:

1. Enter the program from location 1000.


2. Check if locations 1100 to 11FF contain 34.
OUTPUT

Output Address Output Data

1100 34

PROGRAM FOR LENGTH OF STRING :

Memory
Label Opcode Mnemonics Comments
Address

1000

1001
MOV SI,1200 Move 1200 to SI
1002

1003

1004

1005
MOVDX,FFFF Move FFFF to DX
1006

1007

1008

1009 MOV AH,FF Move FF to AH

100A

100B LOOP INC DX Increment DX

100C
MOV AL,[SI] Move content of SI to AL
100D

100E INC SI Increment SI reg.


100F
CMP AH,AL Compare AH & AL
1010

1011
JNZ LOOP Jump if not Zero
1012

1013

1014 MOV Move the content of DX


1015 [1100],DX to 1100

1016

1017 HLT Terminate the program

OUTPUT
Input Address Input Data
1200 15
1201 23
1202 54
1203 25
1204 45

Output Address Output Data

1100 05
FLOW CHART FOR MOV SB

START

ARRAY
START ADDRESS
END ADDRESS

CX=LENGTH
SI START DI END
DR = O[clear]

MOVE 1 BYTE
MOVE SUB

DECREMENT CX

NO
CX =
0
YES

STOP

FLOW CHART OF LENGTH OF STRING

START

1200 <- SI

FFFF <- DX

FF <- AX

DX <- DX+1

AL <-[SI]

Compare AL & AH
NO
IF ZF =
0
YES

STOP
RESULT:

Thus the assembly language program for performing string manipulation was
executed using 8086.
MATRIX OPERATIONS
Expt.No.:
Date:

AIM:
To write an assembly language program for addition of two matrix by using 8086.

APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity

1. MICROPROCESSOR MICRO 86/88 KIT 1


2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

PROCEDURE:
6. Enter the Mnemonics starting from the RAM address1000 by using (A command).
7. Enter the two input data in
8. Execute the program
9. Check the corresponding result
10. Change the data and verify the result
FLOWCHART:
PROGRAM:

ADDRESS OPCODE MNEMONICS HEXCODE COMMENTS


1000 MOV CL,09 BL,09 count for 3 x 3
1001 matrix
1002
1003 MOV SI,2000 BE,00,20 Load address in SI
1004
1005
1006
1007 MOV DI,3000 BF,00,30 Load address in
1008 DI
1009
100A
100B MOV AL,[SI] BA,04 Load AL with
100C matrix
100D MOV BL,[DI] 8A,10 Load BL with
100E matrix
100F ADD AL,BL 00,08 ADD two data
1010
1011 MOV [DI],AL 88,05 Store result
1012
1013 INC DI 4F Increment DI
1014 INC SI 46 Increment SI
1015 DEC CL FE,C9 Decrement CL
1016 JNZ 100B 75,F2 Loop continues
1017 until zero
1018 HLT CC Terminate the
1019 program

OUTPUT FOR MATRIX ADDITION:

INPUT ADDRESS DATA


2000 01 02 03 04 01 02 03 04 01
3000 01 02 03 04 01 02 03 04 01
OUTPUT ADDRESS DATA
3000 02 04 06 08 02 04 06 08 02

RESULT:
Thus the assembly language program for the addition of two matrix was executed
successfully using 8086.
PERIPHERALS AND INTERFACING EXPERIMENTS
TRAFFIC LIGHT CONTROL

Expt.No.:

Date:

AIM:

To write an assembly language program for 'traffic light control' system using 8086
microprocessor.

APPARATUS REQUIRED:

Sl.No. Required Components Specification Quantity


1. Microprocessor micro 86/88 kit 1
2. Traffic light control - 1
3. Power chord +5V supply 1
4. Keyboard - 1

PROGRAM:
Program for the TLC using 8086/88 LED mnemonics
ORG 1000H
CNTRL EQU 26H
PORT A EQU 20H
PORT B EQU 22H
PORT C EQU 24H

Memory Address Opcode Label Mnemonics


1000 START MOV AL, 80H
1001
1002 OUT CNTRL, AL
1003
1004 REPEAT MOV BX, LOOKUP
1005
1006
1007 MOV SI, LABEL
1008
1009
100A CALL OUT
100B
100C

100D MOV AL, [SI]


100E
100F OUT PORT A, AL
1010
CALL DELAY 1
1014 INC SI
1015 INC BX
1016 CALL OUT
1017
1018
1019 MOV AL, [SI]
101A
101B OUT PORT B, AL
101C
101D CALL DELAY 1
101E
101F
1020 INC SI
1021 INC BX
1022 CALL OUT
1023
1024
1025 MOV AL, [SI]
1026
1027 OUT PORT C, AL
1028
1029 CALL DELAY 1
102A
102B
102C INC SI
102D INC BX
102E CALL OUT
102F
1030
1031 MOV AL, [SI]
1032
1033 OUT PORT C, AL
1034
1035 INC SI
1036 MOV AL, [SI]
1037
1038 OUT PORT A, AL
1039
103A CALL DELAY 1
103B
103C
103D JMP REPEAT
103E
103F OUT MOV AL, [BX]
1040
1041 OUT PORT C,AL
1042
1043 INC BX
1044 MOV AL, [BX]
1045
1046 OUT PORT B,AL
1047
1048 INC BX
1049 MOV AL, [BX]
104A
104B OUT PORT A,AL
104C
104D CALL DELAY
104E
104F
1050 RET
1051 DELAY MOV DI, 00040H
1052
1053
1054 A: MOV DX, 0FFFFH
1055
1056
1057 A1: DEC DX

1058 JNZ A1:


1059
105A DEC D1
105B JNZ A:
105C
105D RET
105E DELAY 1: MOV DI, 00015H
105F
1060
1061 B: MOV DX, 0FFFFH
1062
1063
1064 B1 DEC DX
1065 JNZ B1:
1066
1067 DEC DI
1068 JNZ B:
1069
106A RET
106B LOOK UP: DB 12H, 27H, 44H, 10H
106C
106D
106E
106F 2BH, 92H, 10H, 9DH
1070
1071
1072
1073 84H, 48H, 2EH, 84H
1074
1075
1076
1077 LABEL: DB 48H, 4BH, 20H, 49H
1078
1079
107A
107B 04H
107C END

RESULT:

Thus the assembly language program for Traffic Light Control System was executed using
8086 microprocessor.
STEPPER MOTOR CONTROL

AIM:
To write an Assembly Language Program to run the Stepper Motor at different speed using
8086.

APPARATUS REQUIRED

Sl.No Required Components Specification Quantity


1. MICROPROCESSOR MICRO 86/88 KIT 1
2. STEPPER MOTOR 1
STEPPER MOTOR INTERFACE
3. 1
CARD
4. POWER CHORD +5V SUPLLY 1
5. KEY BOARD 1

PROCEDURE:
1.Enter the program for location 1000
2.Connect the stepper motor to 8086 processor
3.Stepper motor will rotate in clockwise direction
4.Vary the speed by loading the value in DX register
5.Vary the direction of motor by changing the contents of look up table
PROGRAM:

Memory Address Opcode Label Mnemonics Comment


1000 START MOV DI,1018 Initialize memory location to
1001 store the array of number
1002
1003
1004 MOV CL,04 Initialize array size
1005
1006
1007 LOOP1 MOV AL,[DI] Copy the first data in AL
1008
1009 OUT CO,AL Send it through port address
100A
100B MOV DX,1010
100C
100D Introduce Delay
100E
100F L1 DEC DX
1010 JNZ L1
1011
1012 INC DI Go to next memory location

1013 LOOP LOOP1 Loop until all the data’s have


1014 been sent

1015 JMP START Go to start location for


1016 continuous rotation
1017
1018 TABLE 09 05 06 Look up table contents
1019 0A
101A
101B

OUTPUT:
stepper motor runs successfully

RESULT:
Thus the assembly language program to run stepper motor was executed successfully using
8086 Microprocessor.
KEYBOARD AND DISPLAY INTERFACE

Expt. No:

Date:

AIM:

To write a assembly language program to display 'A' in the first digit of the display using
8086-8279 keyboard and display interfacing.
APPARATUS REQUIRED:

Sl.No Required Components Specification Quantity


1. MICROPROCESSOR MICRO 86/88 KIT 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1
4 8279 INTERFACING VBMB 001 1

THEORY:
The Intel 8279 is responsible for debouncing of the keys, coding of the keypad matrix and
refreshing of the display elements in a Microprocessor based development system. Its main features
are:
1) Simultaneous Keyboard and Display operation.
1. Input modes such as Scanned Keyboard Mode, Scanned Sensor Mode and Strobed Input Entry
Mode.
2) Output modes such as 8 or 16 character multiplexed displays, right entry or left entry display
formats.
3) Clock Prescaler.
4) Programmable Scan Timing.
5) 2 Key lockout or N-key Roll-over with contact debounce.
6) Auto Increment facility for easy programming.
PROGRAM:

Memory
Opcode Label Mnemonics Comments
Address
1000
1001 MOV AL,00 Set Mode and Display
1002
1003 Send through output port
OUT C2,AL
1004
1005
Store the control word to clear display
1006 MOV AL,CC
1007
1008 Send through output port
OUT C2,AL
1009
100A
Store the control word to write display
100B MOV AL,90
100C
100D Send through output port
OUT C2,AL
100E
100F
Store the control word to display A
1010 MOV AL,88
1011
1012 Send through output port
OUT C0,AL
1013
1014 Store the control word to blank rest of
1015 MOV AL,FF display
1016
1017
1018
MOV CX,0005 Store the data to CX register
1019
101A
101B Send through output port
NEXT OUT C0,AL
101C
101D Loop until all the data’s have been taken
LOOP NEXT
101E
101F HLT Terminate the program
PROCEDURE:

1. Enter the program from location 1000.


2. Connect the 8279 interface kit to 8086 Processor.
3. Execute the Program.
4. The Character will be displayed in the 7 segment display.

OUTPUT:

‘A’DIAPLAYED

RESULT:

Thus the assembly language program to display the character 'A' was executed and output was
verified.
ADC INTERFACING

Expt.No.:
Date:

AIM:
To write an Assembly Language Program to convert analog signal into digital value using an
ADC interfacing.

APPARATUS REQUIRED:
Sl.No Required Components specification Quantity
1. MICROPROCESSOR MICRO 86/88 KIT 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1
4. ADC 0809 1

THEORY:
Microprocessors are Digital logic devices that can process only digital signals that are in
binary form logic levels (either 0 or 1 or 0 volts or 5 volts), But most industrial applications involve
physical variables such as temperature, pressure etc, which are continuously (varying voltage) when
converted to analog signal by transducers & signal condition, unlike digital signals having either a
low or high state. In most cases we want to control these signals electronically. This automatic control
can be achieved using a microprocessor. But microprocessor can understand only digital language.
So there should be some translater who can translate these analog signals to a digital form which the
Microprocessor considers formal. This is the place where an Analog to Digital Converter (ADC)
comes into the picture. Thus an Analog to Digital Converter is an electronic circuit that converts the
analog or continuous signal to digital or discrete.

PROCEDURE:
1. Enter the program from the location 1000
2. Connect the ADC interface kit to 8086 processor
3. Verify the analog input using trimpot and give SOC by pressing SOC switch
4. See the corresponding digital value in the LED display
PROGRAM :

Memory Address Opcode Label Mnemonics Comments


1000 MOV AL, 03 Load accumulator with value
1001
1002 OUT C8, AL Send through output port
1003
1004 MOV AL, 23 Load accumulator with value
1005
1006 OUT C8, AL Send through output port
1007
1008 MOV AL, 03 Load accumulator with value
1009
100A OUT C8, AL Send through output port
100B
100C MOV AL, 01 Store the value to make SOC
100D high in the accumulator

100E OUT D0, AL Send through output port


100F
1010 MOV AL, 00 Load accumulator with value for
1011 ALE high

1012 OUT D0, AL Send through output port


1013
1014 LOOP IN AL, E0 Read the EOC signal from port
1015 and check for end of conversion
1016 AND AL, 01
1017
1018 CMP AL, 01
1019
101A JNZ LOOP If the conversion is not yet
101B completed, read EOC signal
from port again

101C IN AL, C0 Read data from port


101D
101E MOV BX, 1100 Initialize the memory location to
101F store data

1021 MOV[BX], AL Store the data


1022
1023 HLT Stop
1024
FLOW CHART FOR ADC:

Start

Set ALE low

Out to control port

Set ALE low

Out to control port

stop

OUTPUT:
DIGITAL OUTPUT HEXA EQUIVALENT DECIMAL
01010110 56 86

RESULT:
Thus the analog signal was converted to digital value using 8086-ADC interfacing.
INTERFACING DAC WITH 8086

EX NO :

DATE :

AIM :
To generate saw tooth wave , square wave and triangular wave at DAC output.

APPARATUS REQUIRED:

Sl.No Required Components specification Qty


1. MICROPROCESSOR MICRO 8086 KIT 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1
4 DIGITAL TO ANOLOGCONVERTER 0809 1
5 CRO 1

THEORY:

Since DAC 0800 is an 8 bit DAC and the output voltage variation is between –5v and
+5v. The output voltage varies in steps of 10/256 = 0.04 (approximately). The digital data
input and the corresponding output voltages are presented in the table. The basic idea
behind the generation of waveforms is the continuous generation of analog output of DAC.
With 00 (Hex) as input to DAC2 the analog output is –5v. Similarly with FF H as input, the
output is +5v. Outputting digital data 00 and FF at regular intervals, to DAC2, results in a
square wave of amplitude 5v.Output digital data from 00 to FF in constant steps of 01 to
DAC2. Repeat this sequence again and again. As a result a saw-tooth wave will be
generated at DAC2 output. Output digital data from 00 to FF in constant steps of 01 to
DAC2.Output digital data from FF to 00 in constant steps of 01 to DAC2. Repeat this
sequence again and again. As a result a triangular wave will be generated at DAC2 output.

PROCEDURE:

1. Enter the program from location 1000.


2. Connect the DAC interface kit to 8086 Processor
3. View the saw tooth & square wave output in the CRO.
1. PROGRAM FOR DAC (SAW TOOTH WAVE):
Memory Opcodes Label Mnemonics Comments
Address
1000 MOV AL, 00 Move Data to
1001 accumulator
1002 OUT C0, AL Send the value of AL to
1003 control port
1004 INC AL Increment AL register
1005
1006 JNZ L1 Jump if not zero
1007
1008 JMP START Jump to start
1009
100A RET Return

2. PROGRAM FOR DAC (SQUARE WAVE):


Memory Opcodes Label Mnemonics Comments
Address
1000 START MOV AL, 00 Move Data to AL
1001 register
1002 OUT C8, AL Send the value of AL to
1003 control port
1004 CALL DELAY Call the delay
1005
1006
1007 MOV AL, FF Move FF to AL register
1008
1009 OUT C8, AL Send the value of AL to
100A control port
100B CALL DELAY Call the delay subroutine
100C
100D
100E JMP START Jump to start
100F
1010 DELAY MOV CX,05,FF Declare the data to
1011 accumulator
1012

1013 L1 LOOP L1 Move to loop


1014
1015 RET Return
3. PROGRAM FOR DAC (TRIANGULAR WAVE):
Memory Opcodes Label Mnemonics Comments
Address
1000 START MOV BL, 00 Move to accumulator
1001
1002 L1 MOV AL, BL Move AL to BL register
1003
1004 OUT C8, AL Move value of AL to
1005 output port
1006 INC BL Increment the value of
1007 BL register
1008 JNZ L1 Jump if no zero
1009
100A MOV BL,FF Move to FF register
100B
100C L2 MOV AL,BL Move the value of BL to
100D accumulator
100E OUT C8,AL Move value of AL to
100F output port
1010 DEC BL Decrement the value of
1011 BL register
1012 JNC L2 Jump if no carry
1013
1014 JMP START Jump start
1015
1016 RET Return

OUTPUT :
Wave Amplitude (V) Time (ms)

Saw Tooth 2 2

Square Wave 2 3

Triangular Wave 2 3
MODEL GRAPH:

1.Saw Tooth Wave:

2.Square Wave

3.Triangular Wave

RESULT:

Thus the saw tooth wave, square wave and triangular wave generated using DAC
and output was verified.
PROGRAMABLE INTERRUPT CONTROLLER-8259

EX NO :
DATE :

AIM:
To write an assembly language program to interface 8259 programable interrupt controller
with 8086.

APPARATUS REQUIRED:

Sl.No Required Components specification Qty


1. MICROPROCESSOR MICRO 86/88 KIT 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1
4. 8259 INTERFACING VBMB 07 1

THEORY:

The 8259 is a programmable Interrupt Controller that can resolve eight levels of interrupt
priorities in a variety of modes. It can vector an interrupt anywhere in the memory map. It is also
capable of masking each interrupt request individually and read the status of pending interrupts, in-
service interrupts and masked interrupts. The 8259 can be expanded to 64 priority levels by cascading
network.
Initialization command words (ICW s): Before the normal operation can begin , each 8259 in the
system must be initialized using 2 to 4 bytes of ICW s.
Operation command words (OCW s): These are the command words which command the 8259 to
operate in various interrupt modes.

PROCEDURE:
- The program is entered in user RAM locations. On pressing IR0 , the CPU jumps to location
5000H. 8259 will not accept any more interrupt at IR0 since AEOI is not set.
- After it is set , the CPU goes back to main program after performing service addition
subroutine.
- The result addition can be viewed at 4500H location.
PROGRAM:
Memory
Opcodes mnemonics Comments
address
1000
MOV AL,17 Move 17 to accumulator
1001
1002
OUT C0,AL Move contents of AL to C0
1003
1004 Move 15 to accumulator
MOV AL,08
1005 Initialize ICW 2
1006
OUT C2,AL Move contents of AL to C2
1007
1008 Move 00 to accumulator
MOV AL,01
1009 Initialize ICW 4
100A
OUT C2,AL Move contents of AL to C2
100B
100C
MOV AL,FE Move fe to accumulator
100D
100E
OUT C2,AL Move contents of AL to C2
100F
1010 STI Terminate the program
1011
SJMP HERE Subroutine
1012

Interrupt Vector
0020 00
0021 12
0022 00
0023 00

Interrupt Service Routine


Memory
Opcodes mnemonics Comments
address
1200 Move 20 to accumulator
MOV AL,20
1201 Initialize OCW 2 for non specific EOI
1202
OUT C0,AL Send through output port
1203
1204
INT 2 Move 08 to accumulator
1205
OUTPUT:

D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 0 0 0 0 0

RESULT:
Thus the result of addition subroutine was performed at memory location 4500 and the output
was verified using 8259 interfacing.
8253 INTERFACING

EX NO :

DATE :

AIM :

To interface 8253 interface board to 8086 and verify the operation.

APPARATUS REQUIRED

Qty
SL.no Required Components specification

1. MICROPROCESSOR MICRO 8086 KIT 1


2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1
4 8253 INTERFACING VBMB 04 1

PROGRAM :

Memory Address Opcodes Mnemonics Comments


1000 ORG 100H
1001 MOV AL, 36 Move the value to
accumulator
1002 OUT CE, AL Send the data to output
1003 port
1004 MOV AL, 10 Move the value to AL
1005 register
1006 OUT C8, AL Send the data to output
1007 port
1008 MOV AL, 00 Move the value to AL
1009 register
100A OUT C8, AL Send the value to output
100B port
100C HLT Stop
PROCEDURE:

1. Enter the program from location 1000.


2. After giving six clock pulses,we can see high-low waveform by using CRO.
3. The output (OUT 0 Pin) goes high on the next clock pulse.

OUTPUT:
WAVE AMPLITUDE TIME
SQUARE WAVE 3 4

RESULT:

Thus the programmable Timer interface with 8086 and operation is verified.
8051 ARITHMETIC OPERATION

EX NO:

DATE :

AIM:
To perform Arithmetic operation such as addition,subtraction,multiplication & division
using 8051 micro controller.

APPARATUS REQUIRED

Sl.No Required Components specification Qty


1. MICROCONTROLLER MICRO 51LC LCD 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

THEORY:

As there is only one 16-bit Register in 89C51, 16-bit addition is performed by using
ADDC instruction twice, i.e. adding LSD first and MSD next.
Using the accumulator, subtraction is performed and the result is stored. Immediate
addressing is employed. The subtraction instruction writes the result in the accumulator
The 8051 has a MUL instruction unlike many other 8-bit processors. MUL instruction
multiplies the unsigned 8-bit register in A & B, the lower order byte of the product is left in A
and the higher order byte in B, if the product is greater than 255, the OFF is set otherwise it
is cleared, CF always cleared.

EXAMPLE:

The program is to add the 16-bit data 1234 with the data 5678 and store the result at
the locations 4150 and 4151 using immediate addressing.

RESULT: [4150] = AC (LSB);


[4151] = 68 (MSB).
DATAL1 - 34; DATAL2 = 78.
DATAM1 - 12; DATAM2 = 56.
DATAM1 - MSD OF DATA1,
DATAM2 - MSD OF DATA2,
DATAL1 - LSD OF DATA1,
DATAL2 - LSD OF DATA2
1. PROGRAM FOR 16-BIT ADDITION

Memory Address Opcodes Mnemonics Comments


4100 CLR C Clear C register
4101 Move the lower bits of data to
MOV A,#DATAL1
4102 accumulator
4103 Add the contents of accumulator
ADDC A,#DATAL2
4104 with lower bits of data 2
4105
Move the content of location
4106 MOV DPTR,#4150
4150 to data pointer
4107
4108 MOVX @DPTR,A Move content of A to data pointer
4109 INC DPTR Increment data points to 1
410A Move the upper bits of data to
MOV A,#DATAM1
410B accumulator
Add the carry contents of
410C
ADDC A,#DATAM2 accumulator with upper bits of
410D
data 2
Content of accumulator is moved
410E MOVX @DPTR,A
to data pointer
410F
HLT: SJMP HLT Short jump here
4110

1. OUTPUT FOR 8-BIT ADDITION:


Output Address Output Data
4150 AC
2. PROGRAM FOR 8-BIT SUBTRACTION

Memory
Opcodes Mnemonics Comments
Address
4100 CLR C Clear C register
4101 MOV A, # data1
Store data1 in accumulator
4102
4103
SUBB A, # data2 Subtract data2 from data1
4104
4105
MOV DPTR, #
4106 Initialize memory location
4500
4107
Store the difference in memory
4108 MOVX @ DPTR, A
location
4109
SJMP HERE Stop
410A

2. OUTPUT FOR 8-BIT SUBTRACTION:


Output Address Output Data
4500 0A

3. PROGRAM FOR 8-BIT MULTIPLICATION

Memory
Opcodes Mnemonics Comments
Address
4100
MOV A ,#data1 Store data1 in accumulator
4101
4102
4103 MOV B, #data2 Store data2 in B register
4104
4105 MUL A,B Multiply both
4106
MOV DPTR,
4107 Initialize memory location
#4500H
4108
4109 MOVX @ DPTR, A Store lower order result
410A INC DPTR Go to next memory location
410B
MOV A,B
410C Store higher order result
410D MOV @ DPTR, A
410E
HERE:SJMP HERE STOP
410F

3. OUTPUT FOR 8-BIT MULTIPLICATION:


Output Address Output Data
4500 50
4501 05

4. PROGRAM FOR 8-BIT DIVISION

Memory
Opcodes Mnemonics Comments
Address
4100
MOV A ,#data1 Store data1 in accumulator
4101
4102
4103 MOV B, #data2 Store data2 in B register
4104
4105 DIV A,B Divide both A & B
4106
MOV DPTR,
4107 Initialize memory location
#4500H
4108
4109 MOVX @ DPTR, A Store lower order result
410A INC DPTR Go to next memory location
410B
MOV A,B
410C Store higher order result
410D MOV @ DPTR, A
410E
HERE:SJMP HERE STOP
410F

4. OUTPUT for 8-BIT DIVISION:


Output Address Output Data
4500 00
4501 0A
RESULT:

Thus the program to perform Arithmetic operation using 8051 controller was
performed and output was verified.

8051 LOGICAL OPERATION

EX NO:

DATE :

AIM:
To perform Logical operation using 8051 controller

APPARATUS REQUIRED:

Sl.No Required Components specification Qty


1. MICROCONTROLLER MICRO 51LC LCD 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

THEORY:

The one's complement of a number is obtained by inverting all the bits in that number ,
that is replacing all 1's by 0's and all 0's by 1's. The two's complement is the negative of that
number.

PROCEDURE:

1. Enter the opcodes and the data in the trainer.


2. Execute the program and check for results.
3. Change data and check for the corresponding results.
PROGRAM FOR ONE’S COMPLEMENT & 2’S COMPLEMENT:

Memory
Opcodes Mnemonics Comments
Address
4100
MOV A,#DATA Data is moved to accumulator
4101
Complement the content of
4102 CPL A
accumulator
4103
Store the result in my location
4104 MOV DPTR,#4200
4200
4105
4106 Content of accumulator is moved
MOVX @DPTR,A
to DPTR
4107 INC A Increment accumulator

4108 INC DPTR Increment DPTR


Move content of accumulator to
4109 MOVX @DPTR,A
DPTR
410A HERE: SJMP
Short Jump here
410B HERE

OUTPUT:
Output Address Output Data
4500 33
4501 34
2. PROGRAM FOR OR OPERATION:

Memory
Opcodes Mnemonics Comments
Address
4100
MOV A,#DATA1 Move data 1 to register A
4101
4102
ORL A,#DATA2 OR data 2 with accumulator
4103
4104
Move content of 4500 to
4105 MOV DPTR,#4500
DPTR
4106
4107 MOVX @DPTR,A Move content of A to DPTR
4108
HERE: SJMP HERE Stop the Program
4109

2.OUTPUT FOR OR OPERATION:

Output Address Output Data


4500 6F

3. PROGRAM FOR AND OPERATION:


Memory
Opcodes Mnemonics Comments
Address
4100
MOV A,#DATA1 Move data 1 to register A
4101
4102
ANL A,#DATA2 AND data 2 with accumulator
4103
4104
Move content of 4500 to
4105 MOV DPTR,#4500
DPTR
4106
4107 MOVX @DPTR,A Move content of A to DPTR
4108
HERE: SJMP HERE Stop the Program
4109
3.OUTPUT FOR AND OPERATION:

Output Address Output Data


4500 05

4. PROGRAM FOR XOR OPERATION:


Memory
Opcodes Mnemonics Comments
Address
4100
MOV A,#DATA1 Move data 1 to register A
4101
4102
XRL A,#DATA2 AND data 2 with accumulator
4103
4104
Move content of 4500 to
4105 MOV DPTR,#4500
DPTR
4106
4107 MOVX @DPTR,A Move content of A to DPTR
4108
HERE: SJMP HERE Stop the Program
4109

3.OUTPUT FOR XOR OPERATION:

Output Address Output Data


4500 6A

RESULT:
Thus the program to perform Logical operation using 8051 controller was performed
and output was verified.

SQUARE AND CUBE PROGRAM

Expt. No:
Date:

AIM:
To write an assembly language program to perform Square and Cube program using 8051
micro controller.

APPARATUS REQUIRED

Sl.No Required Components specification Qty


1. MICROCONTROLLER MICRO 51LC LCD 1
2. POWER CHORD +5V SUPLLY 1
3. KEY BOARD 1

PROGRAM:Square of a number

address opcode mnemonics


4100 MOV DPTR, #4200H
4101
4102
4103 MOVX A, @DPTR
4104 MOV B,A
4105
4106 MUL AB
4107 INC DPTR
4108 MOVX @DPTR,A
4109 HLT SJMP HLT
410A

OUTPUT FOR SQUARE PROGRAM:


Input address input data
4200 02
output address output data
4201 04

CUBE OF A NUMBER

address label mnemonics opcode comment


MOV DPTR,
#4200H

MOVX A,@DPTR

MOV R0,A

MOV B,A

MUL AB

PUSH B

MOV B,A

MOV A,R0

MUL AB

INC DPTR

MOVX @DPTR,A

MOV A,B

MOV R1,A

POP B

MOV A,R0

MUL AB

ADD A,R1

INC DPTR
MOVX @DPTR,A
MOV A,B

ADDC A,#00
HLT INC DPTR

MOVX @DPTR,A

SJMP HLT

OUTPUT FOR CUBE PROGRAM:


Input address input data
4200 02

output address output data


4201 08

RESULT
Thus the ALP for Square program and Cube program was done using 8051 microcontroller.
ARITHMETIC & LOGIC OPERATION

EX.NO.
DATE.

AIM:

To write assembly language program for performing arithmetic and logic


operations.

APPARATUS REQUIRED:

1.8086 KIT
2.MASM Software
3.PC with windows
4.RS 232 cable

PROCEDURE:

1.In PC,click start menu button and click on RUN and type cmd at command prompt;
Immediately DOS window will appear.
2. Go to masm directory by typing;
E:
Cd masm
3. In the command prompt type, edit filename.asm
4. Go to file option in the menubar to save the program and exit from deitor window.
5. To assemble the program, type
masm filename.asm,,;
6. To link the program type,
Link filename.asm,,;
7. To execute the program, type
Debug filename.exe
8. after executing type
'n filename.bin'
'wcs : 1000'
9. To quit the execution screen type q
10. To initialize data transfer to 8086 kit, type
'dc'
11. In kit, to set the baud rate, type
BU
And set the baud rate(ie.5)
12. Inthe newly appeared window in PC, click setup and provide the needed
parameters.
13. In kit,type SI and then 1000
14. Return back to the window in PC, click transmit data and provide the needed
parameters.
15. After completion of data transfer,in kit,give the input data and execute the
program.View the output in the display 8086 microprocessor kit.

PROGRAM FOR 8-BIT ADDITION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 05h
MOV BL, 03h
ADD AL,BL
MOV SI,1100h
MOV[SI], AL
HLT
code ends
End

OUTPUT: (ADDITION)

1100:08

PROGRAM FOR 8-BIT SUBTRACTION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 05h
MOV BL, 03h
SUB AL,BL
MOV SI,1100h
MOV[SI], AL
HLT
code ends
End

OUTPUT:(SUBTRACTION)
1100:02

PROGRAM FOR 8-BIT MULTIPLICATION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 55h
MOV BL, 53h
MUL BL
MOV SI,1100h
MOV[SI], AL
INC SI
MOV[SI], AH
HLT
code ends
End

OUTPUT:(MULTIPLICATION)

1100:8F
1101:1B

PROGRAM FOR DIVISION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AX,03e8h
MOV BL, 63h
DIV BL
MOV SI,1100h
MOV[SI], AL
INC SI
MOV[SI], AH
HLT
code ends
End
OUTPUT:(DIVISION)

1100:0A
1101:0A

PROGRAM FOR LOGICAL AND OPERATION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 0F5h
MOV BL, 03h
AND AL, BL
MOV SI,1100h
MOV[SI], AL
HLT
code ends
End

OUTPUT:(LOGICAL AND OPERATION)

1100:01

PROGRAM FOR LOGICAL OR OPERATION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 0F5h
MOV BL, 03h
OR AL, BL
MOV SI,1100h
MOV[SI], AL
HLT
code ends
End
OUTPUT:(LOGICAL OR OPERATION)

1100:F7

PROGRAM FOR LOGICAL NOT OPERATION

code segment
assume cs:code, ds:code
ORG 1000H
MOV AL, 55h
NOT AL
MOV SI,1100h
MOV[SI], AL
HLT
code ends
End

OUTPUT:(LOGICAL NOT OPERATION)

1100:AA

RESULT:

Thus assembly language program for arithmetic & logic operations were
executed successfully & output was obtained.

You might also like