0% found this document useful (0 votes)
1 views

Vnd.openxmlformats Officedocument.wordprocessingml.document&Rendition=1

The document is a laboratory manual for the Microprocessors and Microcontrollers course at Jayamukhi Institute of Technological Sciences. It outlines various assembly language programming exercises using the 8086 processor and 8051 microcontroller, including arithmetic operations, data sorting, and interfacing with hardware components. Additionally, it provides guidelines for lab conduct, required equipment, and additional experiments for students in the Electronics and Communication Engineering department.

Uploaded by

saro23958
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Vnd.openxmlformats Officedocument.wordprocessingml.document&Rendition=1

The document is a laboratory manual for the Microprocessors and Microcontrollers course at Jayamukhi Institute of Technological Sciences. It outlines various assembly language programming exercises using the 8086 processor and 8051 microcontroller, including arithmetic operations, data sorting, and interfacing with hardware components. Additionally, it provides guidelines for lab conduct, required equipment, and additional experiments for students in the Electronics and Communication Engineering department.

Uploaded by

saro23958
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 68

JAYAMUKHI INSTITUTE OF TECHNOLOGICAL SCIENCES

(UGC-AUTONOMOUS)

MICROPROCESSORS AND MICROCONTROLLERS

LABORATORY MANNUAL

B.TECH. III YEAR II-SEM: ECE


B.TECH. III YEAR II-SEM: EEE
B.TECH. III YEAR I- SEM: CSE

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


(Accredited by NBA)

JAYAMUKHI INSTITUTE OF TECHNOLOGICAL SCIENCES


(UGC-AUTONOMOUS)
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

(J6430) MICROPROCESSORS AND MICROCONTROLLERS LABORATORY

B. Tech III Year II-Sem: ECE L T P C


0 0 2
1

Cycle 1: Using 8086 Processor Kits and/or Assembler (10 Weeks)

1. Write and execute an Assembly language Program (ALP) to 8086 processor to add, subtract and
multiplication.
2. Write and execute an Assembly language Program (ALP) to 8086 processor to divide a 32 bit
unsigned Number.
3. Write and execute an Assembly language Program (ALP) to 8086 processor to sort the given array of
Numbers.
4. Write and execute an Assembly language Program (ALP) to 8086 processor to Bit level Logical
Operations, Rotate, Shift, Swap and Branch Operations.
5. Write and execute an Assembly language Program (ALP) to 8086 processor to pick the median
from the given String.
6. Write and execute an Assembly language Program (ALP) to 8086 processor to find the length of a
given string.
7. Write and execute an Assembly language Program (ALP) to 8086 processor to reverse the given
string.
8. Write and execute an Assembly language Program (ALP) to 8086 processor to verify the
password.
9. Write and execute an Assembly language Program (ALP) to 8086 processor to insert or delete a
character?
10. Write and execute an Assembly language Program (ALP) to 8086 processor to call a delay
subroutine and display the character on the LED display.
11. Interface a keypad to 8086 microprocessor and display the key number pressed on the 7-
segment display which is also interfaced to 8086.
12. Write an interrupt service routine to 8086 whenever there is an interrupt request on interrupt pin,
which displays “hello” on a LCD.
13. Interface an 8086 microprocessor trainer kit to PC and establish a communication between them
through RS 232.
14. Interface DMA controller to 8086 and transfer bulk data from memory to I/ O device.
15. Interface a stepper motor to 8086 and operate it in clockwise and anti-clock wise by choosing
variable step-size.
16. Interface an 8 bit ADC to 8086 and generate digital output and store it in memory for the given
square/ ramp/ triangle wave form inputs.

Cycle 2: Using 8051 Microcontroller Kit (6 weeks):


Introduction to Kiel IDE
1. Assembly Language Programs to Perform Arithmetic (Both Signed and Unsigned) 16 Bit Data
Operations, Logical Operations (Byte and Bit Level Operations), Rotate, Shift, Swap and Branch
Instructions.
2. Time delay Generation Using Timers of 8051.
3. Serial Communication from / to 8051 to / from I/O devices.
4. Program Using Interrupts to Generate Square Wave 10 KHZ Frequency on P2.1 Using Timer0 8051 in
8bit Auto reload Mode and Connect a 1HZ Pulse to INT1 pin and Display on Port0.Assume Crystal
Frequency as 11.0592MHZ.

Equipment Required:
1. 8086 Microprocessor Trainer Kits.
2. 8051 Microcontroller Trainer Kits.
3. Interfacing Modules: ADC, DAC, Temperature Controllers etc.
4. Interfacing Cards: 8255, 8529 and 8257

Prepared by Verified by Approved by


Mr.N.Lalu Ms.Zulekha Tabassum MD.Hameed pasha
Asst. Professor Asst. Professor HoD-ECE

ADDITIONAL EXPERIMENTS
List of Experiments:

1. Interfacing tone generator.


2. Interfacing DAC to 8086.
3. Traffic light controller.
4. SRAM/DRAM Interfacing.

Equipment Required:

1. Tone generator trainer kit


2. DAC interfacing module
3. Traffic light controller trainer kit

Prepared by Verified by Approved by


Mr.N.Lalu Ms.Zulekha Tabassum MD.Hameed pasha
Asst. Professor Asst. Professor HoD-ECE

DO’S AND DON’TS IN THE LAB


DO’S:-

1. Proper dress has to be maintained while entering in the Lab. (Boys Tuck in and shoes and
girlsshould be neatly dressed)

2. Students should carry observation notes and record completed in all aspects.

3. ALP and its theoretical result should be there in the observation before coming to the next lab.

4. Student should be aware of next ALPs.

5. Students should be at their concerned desktop, unnecessary moment is restricted.

6. Student should follow the procedure to start executing the ALP they have to get signed by the
Lab instructor for theoretical result then with the permission of Lab instructor they need to
switch on the desktop and after completing the same they need to switch off and keep the chairs
properly.

7. After completing the ALP Students should verify the ALP by the Lab Instructor.

8. The Practical Result should be noted down into their observations and result must be shown to
the Lecturer In-Charge for verification.

9. Students must ensure that all switches are in the OFF position, desktop is shut down properly.

DON’Ts:-

1. Don’t come late to the Lab.

2. Don’t leave the Lab without making proper shut down of desktop and keeping the chairs
properly.

3. Don’t leave the Lab without verification by Lab instructor.

4. Don’t leave the lab without the permission of the Lecturer In-Charge.

Quick steps to learn operation with kit procedure to operate kit using assembly language
program.
Step I

Press “E”

EXPAND

LITY_(8086 line assembler/disassembler utility 1.0

Press A

1000:0100 MOV AX, 5555

1000:0103 MOV BX, 4444 program to perform addition of

1000:0106 ADD AX, BX two nos. using 8086 microprocessor.

1000; 0108 INT A5

1000:010A

Press “Q”(Exit)

COMMAND=(goes to command mode)

Execution ofThe Program:

Press “G”

BURST

SRC_SEGM 1000

ADDR 0100

WAIT COMMAND

Checking Content of Registers:

Press “S”

Substut?

Memory (press any key two times)

IO register
Name

AX 9999(result i.e. 5555+4444=9999)

BX 4444

(On pressing enter subsequently all registers contents will display)

Procedure for Machine Code:

After execution of program press “ESC” key and then

Press “S”

Substut?

Memory

SRC_SEGM 1000

ADDR 0100

1000:0100 B8 55 55

1000:0103 B9 44 44

1000:0106 01 D8

1000:0108 CD A5

1. Write and execute an Assembly language Program (ALP) to 8086 processor to add,
subtract and multiplication.
Aim: To perform two 16-bit hexadecimal addition, subtraction and multiplication operations
using immediate addressing mode.
ApparatusRequired:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable
ADDITION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS
Transfer the 16-bit immediate
1000:0100 MOV AX, A3B2 B8 B2 A3 data in to the accumulator
register.
Transfer the 16-bit immediate
1000:0103 MOV BX, C5D2 BB D2 C5 data in to the base register.
Addition between the content
of AX&BX registers again
1000:0106 ADD AX,BX F7 F0 result will be stored in AX
register.
Temporarily to terminate the
1000:0108 INT A5 CD A5 program.

Inputs of The Program:


AX = A3B2
BX = C5D2
Theoretical Calculations:
A3B2
C5D2
6 9 8 4
Outputs:
AX = 6984 BX = C5D2

SUBTRACTION:USING DIRECT ADDRESSING MODE:-


Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS
The content of data in 1600
1000:0100 MOV AX, [1600] A1 00 16 location is copied into the
accumulator register.
The content of data in 1602
1000:0103 MOV BX, [1602] B8 1E 02 16 location is copied into the base
register.
Subtraction between the
content of AX&BX registers
1000:0107 SUB AX,BX 29 D8 again result will be stored in
AX register.
The result in accumulator is
1000:0109 MOV [1604],AX A3 04 16 copied into 1604 location.
Temporarily to terminate the
1000:010C INT A5 CD A5 program.

Inputs of The Program:


AX = [1601][1600]= A3B2
BX = [1603][1602]=C5D2
Theoretical Calculations:
A3B2
C5D2
2200
Outputs:
[1605]1604] = 2200

MULTIPLICATION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS
Transfer the 16-bit immediate
1000:0100 MOV AX, A3B2 B8 B2 A3 data in to the accumulator
register.
Transfer the 16-bit immediate
1000:0103 MOV BX, C5D2 BB D2 C5 data in to the base register.
Multiplication between the
content of AX&BX registers
1000:0106 MUL BX F7 F0 again result will be stored in
AX register.
Temporarily to terminate the
1000:0108 INT A5 CD A5 program.

Inputs of the Program:


AX = A3B2
BX = C5D2
Theoretical Calculations:
A3B2
C5D2
BB04
Outputs:
AX = BB04
BX = C5D2

RESULT:-Hence we performed two 16-bit hexadecimal addition, subtraction and multiplication


operations using immediate addressing mode.

2. Write and execute an Assembly language Program (ALP) to 8086 processor to divide a
32 bit unsigned Number.
Aim: To perform divide 0f two 32- bit unsigned number using direct addressing mode.

ApparatusRequired:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable
Program Code:

MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS
The content of data in 1200
1000:0100 MOV AX, [1200] A1 00 12 location is copied into the
accumulator register.
The content of data in 1202
1000:0103 MOV DX, [1202] 8B 16 02 12 location is copied into the
destination register.
1000:0107 MOV BX,[1204] 8B 1E 04 12 The content of data in 1204
location is copied into the base
register.
Division operation perform
between AX and BX registers.
1000:010B DIV BX F7 F3
After division,the content of
1000:010D MOV [1600],AX A3 00 16 AX is copied into the 1600
location.
After division,the content of
1000:0110 MOV [1602],DX 89 16 02 16 DX is copied into the 1602
location.
Temporarily to terminate the
1000:0114 INT A5 CD A5 program.
5.
Inputs of the Program:

AX= [1201][1200]=A2B3

DX= [1203][1202]=123C

BX= [1205][1204]=E2B1

Theoretical Calculations:
(123C A2B3)16= (305963699)10

(E2B1)16 = (58003)10

58003)305963699(51272

305791816

171883

(51272)10= (0498)16

(171883)10= (149B)16

OUTPUTS:

[1601][1600]=149B

[1603][1602]=0498

RESULT:-Hence we performeddivide 0f two 32- bit unsigned number using direct addressing mode.

3. Write and execute an Assembly language Program (ALP) to 8086 processor to sort the
given array of Numbers.
1. ASCENDIND ORDER:

Aim: To perform to sort the given array numbers in an assembly level language.

Apparatus Required:

1. 8086 trainer kit


2. SMPS
3. Connecting cable
4. Key board

Program Code:

CS:IP LABEL MNEMONICS MACHINE CODE

OPCODE OPERANDS
1000:0100 MOV CL,04 B1 04
1000:0102 DEC CL FE C9
1000:0104 L3 MOV DL,CL 88 CA
1000:0107 MOV SI,1200 BE 00 12
1000:0109 L2 MOV AL,[SI] 8A 04
1000:010C CMP AL,[SI+1] 3A 44 01
1000:010E JL 0115 76 05
1000:0110 XCHG AL,[SI+1] 86 44 01
1000:0113 MOV [SI],AL 88 04
1000:0115 L1 INC SI 46
1000:0116 DEC DL FE CA
1000:0116 JNZ 0109 75 CF
1000:0118 DEC CL FE C9
1000:011A JNZ 0104 75 E6
1000:011B INT A5 CD A5

INPUTS: 02 01 03 04

Theoretical Calculations:

SI SI+1
[1200] [1201] [1202] [1203]
CL=04
02 01 04 03
DL=04
01 02 04 03
DL=03
01 02 04 03
DL=02
01 02 03 04

RESULT:

[1300]:01 [1301]:02
[1302]:03 [1304]:04

2. DESCENDIND ORDER:

Program Code:

CS:IP LABEL MNEMONICS MACHINE CODE

OPCODE OPERANDS
1000:0100 MOV CL,04 B1 04
1000:0102 DEC CL FE C9
1000:0104 L3 MOV DL,CL 88 CA
1000:0107 MOV SI,1300 BE 00 13
1000:0109 L2 MOV AL,[SI] 8A 04
1000:010C CMP AL,[SI+1] 3A 44 01
1000:010E JG 0115 7C 05
1000:0110 XCHG AL,[SI+1] 86 44 01
1000:0113 MOV [SI],AL 88 04
1000:0115 L1 INC SI 46
1000:0116 DEC DL FE CA
1000:0116 JNZ 0109 75 CF
1000:0118 DEC CL FE C9
1000:011A JNZ 0104 75 E6
1000:011B INT A5 CD A5
INPUTS:

[1300] [1301] [1302] [1303]


02 01 03 04
TheoreticalCalculations:

SI SI+1
[1300] [1301] [1302] [1303]
DL=04
02 01 04 03
DL=03
02 04 01 03
DL=02
02 04 03 01
DL=01
01 02 0 01
DL=00
04 03 02 01

RESULT:

[1300]:04 [1301]:03 [1302]:02 [1304]:01

RESULT:-Hence we performed to sort the given array numbers in an assembly level language.

4. Write and execute an Assembly language Program (ALP) to 8086 processor to Bit level
Logical Operations, Rotate, Shift, Swap and Branch Operations.
Aim: To Perform To Bit Level Logical Operations, Rotate, Shift, Swap And Branch Operations
Using Immediate Addressing Mode.

1. BIT LEVEL LOGICAL OPERATIONS:

AND Gate:

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,1234 B8 34 12

1000:0103 MOV BX,5678 B3 78 56

1000:0106 AND AX,BX 21 D8

1000:0108 INT A5 CD A5

INPUTS:

AX=1234 BX=5678

Theoretical calculations:

0001 0010 0011 0100


0101 0110 0111 1000

0001001000110000

Output:

AX =1230 BX= 5678 CX = 0000 DX = 0001 FX= F803


Truth Table:

OR Gate:
Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,1234 A1 42 13

1000:0103 MOV BX,5678 88 28 81

1000:0106 OR AX,BX 18 27

1000:0108 INT A5 A5

Inputs:
AX= 1234 BX=5678

Theoretical calculations:
0001 0010 0011 0100
0101 0110 0111 1000
0101 0110 0111 1100

Outputs:

AX= 567C BX = 5678 CX = 0000 DX= 0001 FX= F803

Truth Table:

XOR Gate:
Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,[1200h] C7 06 00

1000:0103 MOV BX,[1202h] 12 34 12 C7

1000:0107 XOR AX,BX 06 02

1000:0109 MOV [1200H],AX 12 78 56

1000:010C INT A5 A1 00 A5

Inputs:
AX=1234 BX=5678

Theoretical Calculations:
0001 0010 0011 0100
0101 0110 0111 1000
0100 0100 0100 1100

Output:

AX= 444C BX= 5678 CX=0000 DX= 0000 FX= F002

Truth Table:

2.ROTATE OPERATIONS:
Rotate left operation:

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 ROL AX,CL D3 C8

1000:0107 MOV [1200],AX A3 00 12


1000:010A INT A5 CD A5

Inputs:
[1501]- 78 [1500] 04

Theoretical:

0111 1000 0000 0100(Input)


1111 0000 0000 1000(First Turn)
1110 0000 0001 0001(Second Turn)
E 0 1 1

Output:

1200-11
1201- E0

Rotate right operation:

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 ROR AX,CL D3 C8

1000:0107 MOV [1200],AX A3 00 12

1000:010A INT A5 CD A5

Inputs:
[1501]- 43 [1500] 42

Theoretical:
0100 0011 0100 0010(Input)
0010 0001 1010 0001(First Turn)
1001 0000 1101 0000(Second Turn)
9 0 0 0

Output:

1200-D0
1201- 90

ROTATE LEFT THROUGH CARRY:

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 RCL AX,CL D3 C8

1000:0107 MOV [1200],AX A3 00 12

1000:010A INT A5 CD A5

Inputs:
[1501]- 24 [1500]- 12

Theoretical:

0010 0100 0001 0010(INPUT)


0100 1000 0010 0100(FIRST TURN)
1001 0000 0100 1000(SECOND TURN)/OUTPUT
9 0 4 8

Output:

1200-48
1201- 90

ROTATE RIGHT THROUGH CARRY:

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 RCR AX,CL D3 C8

1000:0107 MOV [1200],AX A3 00 12

1000:010A INT A5 CD A5

Inputs:
[1501]- 19 [1500]-20

Theoretical:

0001 1001 0010 0000(INPUT)


0000 1100 1001 0000(FIRST TURN)
0000 0110 0100 1000(SECOND TURN)/OUTPUT
0 6 4 8

Output:

1200-48 1201- 06

4. shift operations:ROL

Programming Code:

CS:IP MNEMORIES MACHINE CODE


OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 SHL AX,CL D3 E8

1000:0107 MOV [1200],AX A3 00 12

1000:010A INT A5 CD A5

Inputs:
[1501]- 07 [1500] 27

Theoretical:

0000 0111 0010 01101(INPUT)


0000 1110 0100 1110(FIRST SHIFT)
0001 1100 1001 1100(SECOND SHIFT)/OUTPUT
1 C 9 C

Output:

1200-9C
1201- 1C

ROR:

Programming Code:

CS:IP MNEMORIES MACHINE CODE


OPCODE OPERANDS

1000:0100 MOV AX,[1500] A1 00 15

1000:0103 MOV CL,02 B1 02

1000:0105 SHR AX,CL D3 E8

1000:0107 MOV [1200],AX A3 00 12

1000:010A INT A5 CD A5

Inputs:
[1501]- 81 [1500] 96

Theoretical:

1000 0001 1001 0110 (INPUT)


0100 0000 1100 1011(FIRST SHIFT)
0010 0000 0110 0101(SECOND SHIFT)/OUTPUT
2 0 6 5

Output:

1200-65
1201- 20

Result: Hence we Performed To Bit Level Logical Operations, Rotate, Shift, Swap And Branch
Operations Using Immediate Addressing Mode.

5. Write and execute an Assembly language Program (ALP) to 8086 processor to pick the
median from the given String.

Aim:To perform operation to pick the median of given string by using direct addressing mode
Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV SI,1200 BE 00 12

1000:0103 MOV AX,0007 B8 07 00

1000:0106 MOV BX,0001 F7 F3

1000:0109 DIV BX D1 C6

1000:010B ADD SI,AX 8B 0C

1000:010D MOV CX,[SI] 8B 0C

1000:010F INT A5 CD A5

Inputs:
[1200]- 50 [1201] 35 [1202] 12 [1203] 49
[1204] 03 [1205] 05 [1206] 07

Output:

AX 0003 BX 0002 CX 0349 DX 0001 FX F006

Result:Hence we perform operation to pick the median of given string by using direct
addressing mode

6. Write and execute an Assembly language Program (ALP) to 8086 processor to find the
length of a given string.

Aim: To perform the program to get the length of a stringy the concept of string manipulation

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV CL,00 B1 00
1000:0102 MOV SI,1200 BE 00 12
1000:0105 L2 MOV AL,[SI] 8A 04
1000:0107 CMP AL,FF 3C FF
1000:0109 JNZ 0110 74 05
1000:010B INC CL FE C1
1000:010D INC SI 46
1000:010E JMP 0105 EB F5
1000:0110 L1 INT A5 CD A5

Inputs:
[1200]-01 [1201]-02 [1202]-03 [1203]-04 [1204]-FF

Output:

AX= 00FF BX= 0000 CX= 0006 DX= 0000 FX= F046

Result: Hence we performedto get the length of a stringy the concept of string manipulation

7. Write and execute an Assembly language Program (ALP) to 8086 processor to reverse
the given string.

Aim: To perform the reverse of string operation by the concept of string manipulation

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:

MNEMORIES
CS:IP Label MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV CL,05 B1 05
1000:0102 MOV SI,1200 Be 00 12
1000:0105 MOV DI,1304 BF 04 13
1000:0108 L1 MOV AL,[SI] BA 04
1000:010A MOV [DI],AL 88 05
1000:010C DEC CL FE C9
1000:010E INC SI 46
1000:010F DEC DI 4F
1000:0110 CMP CL,00 80 F9 00
1000:0113 JNZ 0108 75 F3
1000:0115 INT A5 A5

Inputs:
[1200]-01 [1201]-10 [1202]-02 [1203]-03 [1204]-00

Output:

[1300]-00 [1301]-03 [1302]-02 [1303]-10 [1304]-01

Result: Hence we performed to reverse the given string.

8. Write and execute an Assembly language Program (ALP) to 8086 processor to verify the
password.

Aim: To write the password verification program in 8086 microprocessor in assembly level language by
using direct addressing mode

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV CL,05 B1 00
1000:0102 MOV SI,1200 BE 00 12
1000:0105 MOV DI,1300 BF 00 13
1000:0108 L2 MOV AL,[SI] 8A 04
1000:010A MOV BL,[DI] 8A 1D
1000:010C CMP AL,BL 38 D8
1000:010E JNZ 0116 75 06
1000:0110 INC SI 46
1000: 0111 INC DI 47
1000:0112 DEC CL FE C9
1000:0114 JNZ L2 75 F2
1000:0100 L1 INT A5 CD A5

Inputs:

[1200]-78 [1201]-08 [1202]-07 [1203]-01 [1204]-21


READING/VERIFICATION:
[1300]-78 [1301]-08 [1302]-07 [1303]-01 [1304]-21

Output:

AX 0023 BX 0023 CX 0000 DX 0000 FX F046

Result: Hence we performedto verify the password.

9. Write and execute an Assembly language Program (ALP) to 8086 processor to delete a
character/element?

Aim:-write an ALP to delete an element from a string using normal instructions.

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable
Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV SI,2000 BE 00 20
1000:0103 MOV CL,[SI] 8A 0C
1000:0105 MOV DI,3000 BF 00 30
1000:0108 MOV DX,0000 BA 00 00
1000:010B MOV DL,[DI] 8A 15
1000:010D SUB CL,DL 28 D1
1000:010F ADD SI,DX 01 06
1000: 0111 L MOV AL,[SI+1] 8A 44 01
1000:0114 MOV [SI],AL 88 04
1000:0116 DEC CL FE C9
1000:0118 INC SI 46
1000:0119 JNZ 0111 75 F6
1000:101B INT A5 CD A5

Results:
Inputs Outputs

2000=10h 2000=10h
2001=20h 2001=30h
2002=30h 2002=40h
2003=40h

INSERT AN ELEMENT:

Aim:-write an ALP to insert an element from a string using normal instructions.

Apparatus:
1. 8086 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable

Programming Code:
MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS

1000:0100 MOV SI,2000 BE 00 20

1000:0103 MOV CL,[SI] 8A 0C

1000:0105 MOV DI,3000 BF 00 30

1000:0108 MOV DX,0000 BA 00 00

1000:010B MOV DL,[DI] 8A 75

1000:010D SUB CL,DL 28 75

1000:010F INC CL FE C1

1000:010F ADD SI,DX 01 D6

1000: 0111 L1 MOV AH,[SI] 8A 44 01

1000:0113 INC DI 47

1000:0115 MOV AL,[DI] 8A 05

1000:0116 MOV [SI],AL 88 04

1000:0118 INC SI 46

1000:011A MOV AL,[SI] 8A 04

1000:011B MOV [SI],AH 88 24

1000:011D MOV AH,AL 88 C4

1000:011F DEC CL FE C9

1000:1011 JNZ 0111 75 F6

1000:1013 INT A5 CD A5

Results:
Inputs Outputs

2000=10h 2000=10h
2001=20h 2001=20h
2002=30h 2002=30h
2003=50h 2003=40h
2004=50h
Result: Hence we performedto insert an element into a string using normal instruction.

10. Write and execute an Assembly language Program (ALP) to 8086 processor to call a
delay subroutine and display the character on the LED display.

Aim:-write an ALP in 8086 to display string of characters from left to right(left entry mode) in
output mode.

Apparatus:
1. 8086 trainer kit
2. Intel 8279 interfacing module
3. SMPS
4. Keyboard
5. Connecting power cable
Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS
4000 MOV AL,09 B0 09
4002 MOV DX,CTRL BA 02 30
4005 OUT DX,AL EE
4006 MOV AL,31 B0 31
4008 OUT DX,AL EE
4009 MOV AL,D0 B0 D0
400B OUT DX,AL EE
400C MOV CX,FFFF B9 FF FF
400F L1 LOOP L1 E2 FE
4011 MOV AL,00 B0 00
4013 OUT DX,AL EE
4014 MOV AH,08 B4 08
4016 MOV DX,3000 BB 00 30
4019 MOV AL,90 B0 90
401B OUT DX,AL EE
401C MOV AL,[BX] 8A 07
401E MOV DX,3000 BA 00 30
4021 OUT DX,AL EE
4022 MOV CX,FFFF B9 FF FF
4025 L2 LOOP L2 E2 FE
4027 INC BX 43
4028 DEC AH FE CC
402A JNZ UP 75 F0
402C MOV CX,FFFF B9 FF FF
402F L3 LOOP L3 E2 FE
4031 INT A5 CD A5

Results:
After Executing The Program 8 Characters Are Displayed On 7 Segment Display At A
Stretch Of Four Characters From Left To Right.
0 1 2 3

4 5 6 7

2. Aim:-write an ALP in 8086 to display string of characters from right to left in decode
mode.

Programming Code:

MNEMORIES
CS:IP MACHINE CODE
OPCODE OPERANDS
4000 MOV AL,09 B0 09
4002 MOV DX,CTRL BA 02 30
4005 OUT DX,AL EE
4006 MOV AL,31 B0 31
4008 OUT DX,AL EE
400C MOV CX,FFFF B9 FF FF
400F L1 LOOP L1 E2 FE
4011 MOV AL,11 B0 11
4013 OUT DX,AL EE
4014 MOV AH,08 B4 08
4016 MOV DX,3000 BB 00 30
4019 MOV AL,90 B0 90
401B OUT DX,AL EE
401C MOV AL,[BX] 8A 07
401E MOV DX,3000 BA 00 30
4021 OUT DX,AL EE
4022 MOV CX,FFFF B9 FF FF
4025 L2 LOOP L2 E2 FE
4027 INC BX 43
4028 DEC AH FE CC
402A JNZ RPT 75 F0
402C MOV CX,FFFF B9 FF FF
402F L3 LOOP L3 E2 FE
4031 INT A5 CD A5

11. Interface a keypad to 8086 microprocessor and display the key number pressed on the
7- segment display which is also interfaced to 8086.

Aim:-write an ALP to 8086 microprocessor and display the key number pressed on the 7-
segment display which is also interfaced to 8086.

Apparatus:

1. 8086 trainer kit.


2. Scan display and thumbwheel switch interface.
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1057:0100 XOR AX,AX 31 C0
1057:0102 MOV SS,AX 8E D0
1057:0104 MOV ES,AX 8E C0
1057:0106 MOV SP,11F0 BC F0 11
1057:0109 PUSH CS 0E
1057:010A POP DS 1F
1057:010B MOV DX,8807 BA 07 88
1057:010E MOV AL,81 B0 81
1057: 0110 OUT DX,AL EE
1057:0111 L6 MOV BP,1225 BD 25 12
1057:0114 MOV BX,018B BB 8B 01
1057:0117 MOV CL,01 B1 01
1057:0119 CALL 017C E8 60 00
1057:011C ADD AL,BL 00 D8
1057:011E MOV BL,AL 88 C3
1057:0120 MOV AL,[BX] 8A 07
1057:0122 MOV [BP+00],AL 88 46 00
1057:0125 MOV CL,02 B1 02
1057:0127 CALL 017C E8 52 00
1057:012A MOV BX,018B BB 8B 01
1057:012D ADD AL,BL 00 D8
1057:012F MOV BL,AL 88 C3
1057:0131 MOV AL,[BX] 8A 07
1057:0133 INC BP 45
1057:0134 MOV [BP+00],AL 88 46 00
1057:0137 INC BP 45
1057:0138 MOV DL,00 B2 00
1057:013A MOV [BP+00],DL 88 56 00
1057:013D INC BP 45
1057:013E MOV [BP+00],DL 88 56 00
1057:0141 L1&L5 MOV BP,1225 BD 25 12
1057:0144 MOV CL,80 B1 80
1057:0146 L2 MOV AL,CL 88 C8
1057:0148 ROL AL,01 D0 C0
1057:014A AND AL,0F 24 0F
1057:014C JZ 0141(L1) 74 F3
1057:014E MOV DX,8801 BA 01 88
1057:0151 OUT DX,AL EE
1057:0152 MOV CL,AL 88 C1
1057:0154 MOV AL,[BP+00] 8A 46 00
1057:0157 MOV DX,8803 BA 03 88
1057:015A OUT DX,AL EE
1057:015B MOV AL,00 B0 00
1057:015D OUT DX,AL EE
1057:015E INC BP 45
1057:015F MOV AH,0B 84 0B
1057:0161 INT A1 CD A1
1057:0163 CMP AL,FF 3C FF
1057:0165 JNZ 0146(L2) 75 DF
1057:0167 MOV AH,08 B4 08
1057:0169 INT A1 CD A1
1057:016B CMP AL,1B 3C 1B
1057:016D JZ 0177(L3) 74 08
1057:016F CMP AL,0D 3C 0D
1057:0171 JZ 0175(L4) 74 02
1057:0173 JMP 0141(L5) EB CC
1057:0175 L4 JMP 0111(L6) EB 9A
1057:0177 L3 INT A3 CD A3
1057:0179 NOP 90
1057:017A NOP 90
1057:017B NOP 90
1057:017C MOV AL,CL 88 C8
1057:017E MOV DX,8801 BA 01 88
1057:01781 OUT DX,AL EE
1057:0182 MOV DX,8805 BA 05 88
1057:0185 IN AL,DX EC
1057:0186 NOT AL F6 D0
1057:0188 AND AL,0F 24 0F
1057:018A RET C3

“DISP” PROGRAMME

1057:019B MOV DX,8807 BA 07 88


1057:019E MOV AL,81 B0 81
1057:01A0 OUT DX,AL EE
1057:01A1 L1&L3 MOV BX,0195 BB 95 01
1057:01A4 MOV CL,80 B1 80
1057:01A6 L2 MOV AL,CL 88 C8
1057:01A8 ROL AL,01 D0 C0
1057:01AA AND AL,0F 24 0F
1057:01AC JZ 01A1(L1) 74 F3
1057:01AE MOV DX,8801 BA 01 88
1057:01B1 OUT DX,AL EE
1057:01B2 MOV CL,AL 88 C1
1057:01B4 PUSH CS 0E
1057:01B6 POP DS 1F
1057:01B8 MOV DX,8803 BA 03 88
1057:01BB OUT DX,AL EE
1057:01BC MOV AL,00 B0 00
1057:01BE OUT DX,AL EE
1057:01BF INC BX 43
1057:01C0 MOV AH,0B B4 0B
1057:01C2 INT A1 CD A1
1057:01C4 CMP AL,FF 3C FF
1057:01C6 JNZ 01A6(L2) 75 DE
1057:01C8 MOV AH,08 B4 08
1057:01CA INT A1 CD A1
1057:01CC CMP AL,1B 3C 1B
1057:01CE JZ 0177 74 A7
1057:01D0 JMP 01A1(L3) EB CF
1057:01D2 INT A5 CD A5
LOOKUP THIS TABLE CONTENTS 7 SEGMENT EQUILANTS OF NUMBERS 0 TO 9 AND
FOR DIGITS D , I , S , P

1057:018B 3F 06 5B 4F 66

1057:0190 6D(2) 7D(3) 07(4) 7F(5) 6F(6) 5E(7) 06(8) 6D(9)-73

12. Write an interrupt service routine to 8086 whenever there is an interrupt request on
interrupt pin, which displays “hello” on a LCD.

Aim:-write an ALP to displays “HELLO” and “ANSHUMAN”

Apparatus:
1. 8086 trainer kit
2. 8259 TRAINER KIT
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000:0100 JMP 0115 EB 13 90
1000:0103 HELLO:DB 41 4E 53 48 55 4D 41 4E 03
1000:010C ANSHUMAN:DB 41 4E 53 48 20 4C 43 36 03
1000:0115 MOV AX,11F0 B8 11 F0
1000:0118 MOV SP,AX 8B E0
1000:011A PUSH CS 0E
1000:011B POP AX 58
1000:011C MOV DS,AX 8E D8
1000: 011E NOP 90
1000:011F NOP 90
1000:0120 NOP 90
1000:0121 MOV CX,AX 8B C8
1000:0123 MOV SI,5510 BE 01 55
1000:0126 MOV AL,96 B0 96
1000:0128 INT BE CD BE
1000:012A MOV AL,13 B0 13
1000:012C MOV DX,9400 BA 94 00
1000:012F OUT DX,AL EE
1000:0130 MOV AL,90 B0 90
1000:0132 MOV DX,9402 BA 94 02
1000:135 OUT DX,AL EE
1000;0136 MOV AL,01 B0 01
10000:0138 OUT DX,AL EE
1000:0139 MOV AL,BF B0 BF
1000:013B OUT DX,AL EE
1000:013C STI FB
1000:013D L1 MOV AX,0001 B0 00 01
1000:0140 L2 MOV CX,FF ACFF B9 FF FF
1000:0143 INT AA CD AA
1000:0145 DEC AX 48
10000:0146 JNZ 0140(L2) 75 F8
1000:0148 INT AC CD AC
1000:014A MOV BX,0103 BB 01 03
1000:014D INT AF CD AF
1000:014F STI FB
1000:0150 JMP 013D(L2) EB EB
1000:0152 NOP 90
1000:0153 NOP 90
1000:0154 NOP 90
1000:0155 INT AC CD AC
1000:0157 MOV BX,010C BB 01 0C
1000:015A INT AF CD AF
1000:015C MOV AL,20 B0 20
1000:015E MOV DX,9400 BA 94 00
1000:0161 OUT DX,AL EE
1000:0162 IRET CF
1000:0163 INT A5 CD A5

Results:
The IR6 of 8259 is used in edge triggered mode. In the main routine “HELLO” is
displayed, and when positive edge triggered is applied at IR6 pin of 8259 (that is when you press
STEP push button),the display shows “ANSHUMAN”.The STEP push but (next to the RESET
push button)is connected to the IR6 pin of 8259 through inverter.the SSTP signal from STEP
push button is active LOW, thus a positive edge pulse will be applied to IR6 pin when we press
the STEP push button.

Note:- 1) do not forget to short 2-3/L18.

2)8088 based—if you are using 8088 in place of 8086(PL4 on MPU shorted near
U12),then using substitute memory command load at scratch pad address as follows.

0000:03FC=55,:03FD=01,:03FE=A4,:03FF=10

13. Interface an 8086 microprocessor trainer kit to PC and establish a communication


between them through RS 232.

Aim:-to perform 8086 microprocessor trainer kit to PC and establish a communication between
them through RS 232.

Procedure:

1. Use 9 pin D female to 25 pin D female connector cable assembly.


2. In ANSHUMAN kit monitor, serial link software is built in monitor.

a) R or shift-G TO work with intelligent terminal. Here onboard display keyboard
gets disabled.
b) U or shift-Dserial OP – to send information package from kit to PC.
c) I or shift-Cserial IN – to receive information package from kit to PC.
d) A,N(shift-A) meant for demonstration of RS232c from kit to kit. With PC – choose
no echo ,nopr(no priority),hex(intel hex) mode. Use baud rate of 2400.
3. Use “PC SERIAL” floppy given on drive of PC. It is write protected.

a) Execute PCSERIAL.exe to put PC in intelligent terminal mode.


b) For transmission from PC to kit user F5 twice and set send mode. Use +key to
change mode if required.
c) For reception into PC from kit-use F5 twice 7 set receivemode. Use +key to change if
required.
d) Don’t change any other parameters. They are all set suitable for kit.
e) Use ALT-T to begin file transfer in either direction. Use ALT-K to abort file transfer
in either direction.
f) Cntrl – break to escape to DOS.

14. Interface DMA controller to 8086 and transfer bulk data from memory to I/ O device.

Aim:-write an ALP to transfer bulk data from memory to I/ O device.

Apparatus:
1. 8086 trainer kit
2. 8257 TRAINER KIT
3. SMPS
4. Keyboard
5. Connecting power cable

Procedure:

1) Keep the periware on the left hand side of the kit and connect through 50 pin FRC.
2) Make S1 and S2 towards you to enable single stepping.
3) Enter the software code as given.
4) After executing the program the data 55 at memory location C000:0000H and data AA at
C000:0002H are displayed alternately on the LED’s.
5) Execute the program by pressing G, CR, CR, 13CB, CR, 0100, CR and observe on
LED’s the following result.
For active low signals “L” implies led is lighted.

For active high signal “1” implies led is lighted.

“_”implies don’t care condition.

ADDR
bus
Data TC HRQ AEN IR IW MR MW CS
bus (A0-
A3)

START 00 8 - - - - L - L L

STEP 1 01 5 - - - - L - L L

STEP 2 80 5 - - - - L - L L

STEP 3 00 4 - - - - L - L L

STEP 4 B0 4 - - - - L - L L

STEP 5 01 7 - - - - L - L L

STEP 6 80 7 - - - - L - L L

STEP 7 00 6 - - - - L - L L

STEP 8 B0 6 - - - - L - L L

STEP 9 84 8 - - - - L - L L

Now at this stage insert the patch cord in DRQ-2tag and connect it to Vcc, to generate
DMA request for ch.2, when HRQ-1 led glows connect HLDA tag through patch cord and press
step key.data will be appear on data bus as shown below.

ADDR
bus
Data TC HRQ AEN IR IW MR MW CS
bus (A0-
A3)

START 55 0 - 1 1 - L L - -

AA 1 1 1 1 - L L - -

STEP 1 55 0 0 1 1 - L L - -

On Giving Further Steps Same Result Will Be Repeated Alternately As Shown In Step 10 And
11 Above.

Note:-To Come Out Of This Mode Press Reset.

15. Interface a stepper motor to 8086 and operate it in clockwise and anti-clock wise by
choosing variable step-size.

Aim:-write an ALP to rotate the stepper motor operate it in clockwise and anti-clock wise by
choosing variable step-size.

Apparatus:
1. 8086 trainer kit
2. Stepper motor module
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000 MOV DX,0013 BA 13 00
1003 MOV AL,80 B0 80
1005 OUT DX,AL EE
1006 L3 MOV CL,64 B1 64
1008 L1 MOV DX,0012 BA 12 00
100B MOV AL,77 B0 77
100D OUT DX,AL EE
100E CALL 104B EB EF 0F
1011 MOV AL,BB B0 B8
1013 OUT DX,AL EE
1014 CALL DELAY EB E0 0F
1017 MOV AL,DD B0 DD
1019 OUT DX,AL EE
101A CALL 104B EB EF 0F
101D MOV AL,EE B0 EE
101F OUT DX,AL EE
1020 CALL 104B EB EF 0F
1023 DEC CL FE C9
1025 JNE 1008(L1) 75 E1
1027 MOV CH,32 85 32
1029 L2 MOV DX,0012 BA 12 00
102C MOV AL,EE B0 EE
102E OUT DX,AL EE
102F CALL 104B EB EF 0F
1032 MOV AL,DD B0 DD
1034 OUT DX,AL EE
1035 CALL 104B EB EF 0F
1038 MOV AL,BB B0 BB
103B CALL 104B EE EF 0F
103E MOV AL,77 B0 77
1040 OUT DX,AL EE
1041 CALL 104B EE EF 0F
1044 DEC CH FE CD
1046 JNE 1029(L2) 75 E1
1048 JMP 1006(L3) E9BB FE
104A INT A5 CD A5

DELAY PROGRAM

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
104B MOV BX,FFFF BB 10 4B
104E L1 DEC BX 4B
104F JNE 104E(L1) 75 F0
1051 RET C3
Result:-

After executing the program, first stepper motor is rotated two times in clock wise
direction and then one time in anti-clock wise direction and repeats the same until the
microprocessor kit is resetted.

16. Interface an 8 bit ADC to 8086 and generate digital output and store it in memory for
the given square/ ramp/ triangle wave form inputs.

Aim:-write an ALP in 8086 to convert Analog information into the digital by interfacing ADC
module through Intel 8255.

Apparatus:
1. 8086 trainer kit
2. ADC interfacing module
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMORIES
CS:IP LABLE MACHINE CODE
OPCODE OPERANDS
1000 MOV DX,0013 BA 13 00
1003 MOV AL,91 B0 91
1005 OUT DX,AL EE
1006 MOV DX,0011 BA 11 00
1009 MOV AL,60 B0 60
100B OUT DX,AL EE
100C MOV AL,E0 B0 E0
100E OUT DX,AL EE
100F MOV AL,80 B0 80
1011 OUT DX,AL EE
1012 MOV AL,E0 B0 E0
1014 OUT DX,AL EE
1015 L1 MOV DX,0012 BA 12 00
1018 IN AL,DX EC
1019 AND AL,01 24 01
101B CMP AL,01 3C 01
101D JNE 1015(L1) 75 F6
101F MOV DX,0011 BA 11 00
1022 MOV AL,60 B0 60
1024 OUT DX,AL EE
1025 MOV DX,0010 BA 10 00
1028 IN AL,DX EC
1029 MOV [2000],AL 88 06 00 20
102D INT A5 CD A5
RESULTS:

1) i/p=0v o/p=00h
2) i/p=4v o/p=CCh
3) i/p=5v o/p=FCh

Hence the interfacing of ADC by using 8255 PPI is implemented and output is verified.
Cycle 2:-

1. Assembly Language Programs to Perform Arithmetic (Both Signed and Unsigned) 16 Bit
Data Operations, Logical Operations (Byte and Bit Level Operations), Rotate, Shift, Swap
and Branch Instructions.

Aim: To perform two 8-bit hexadecimal addition, subtraction and multiplication operations
using immediate addressing mode for 8051 microcontroller.
ApparatusRequired:
1. 8051 trainer kit
2. SMPS
3. Keyboard
4. Connecting power cable
ADDITION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#33 74 33 Load 33 in accumulator.

6002 MOV R0,#22 78 22 Load with 22 in R0 register.


6004 ADD A, R0 28 Add A with R0 register.

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


6008 MOVX @DPTR,A F0 Move content of A into
7000 location.
6009 RET 22 Return to command mode

Inputs ofthe Program:


A = 33
R0 = 22
Theoretical Calculations:
33
22
55
Outputs:A= 55 OR 7000= 55

SUBTRACTION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#33 74 33 Load 33 in accumulator.

6002 MOV R0,#22 78 22 Load with 22 in R0 register.

6004 SUBB A, R0 98 Sub A with R0 register.

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


6008 MOVX @DPTR,A F0 Mov content of A into 7000
location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 33
R0 = 22
Theoretical Calculations:
33
22
11
Outputs:A= 11 OR 7000= 11

MULTIPLICATION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#02 74 02 Load 02 in accumulator.

6002 MOV F0,#04 78 04 Load with 04 in R0 register.

6004 MUL AB A4 Multiply A& B.

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6008 MOVX @DPTR,A F0 location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 02
R0 = 04
Theoretical Calculations:
02
04
08
Outputs:A= 08 OR 7000= 08

DIVISION:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#08 74 08 Load 08 in accumulator.

6002 MOV F0,#02 78 02 Load with 02 in R0 register.

6004 MUL AB 84 Multiply A& B.

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6008 MOVX @DPTR,A F0 location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 08
R0 = 02
Theoretical Calculations:
08
02
04
Outputs:A= 04 OR 7000= 04

LOGICAL OPERATIONS:
Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#23 74 23 Load 23 in accumulator.

6002 MOV F0,#12 75 F0 12 Load with 12 in F0 register.

6004 ANL A,F0 55 F0 And gate operation between


A &F0

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6008 MOVX @DPTR,A F0 location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 23
R0 = 12
Theoretical Calculations:
00100011
00010010
00000010
Outputs:A= 02 OR 7000= 02

Program Code: OR GATE


MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#14 74 14 Load 14 in accumulator.

6002 MOV F0,#13 75 F0 13 Load with 13 in f0 register.

6004 ORL A,F0 45 F0 OR gate operation between


A &F0

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6008 MOVX @DPTR,A F0 location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 14
R0 = 13
Theoretical Calculations:
0 0 01 1 0 00
00010011
00010111
Outputs:A= 17 OR 7000= 17

Program Code:XOR GATE


MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#15 74 15 Load 15 in accumulator.

6002 MOV F0,#10 75 F0 10 Load with 10 in f0 register.

6004 XRL A,F0 65 F0 XOR gate operation


between A &F0

6005 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6008 MOVX @DPTR,A F0 location.
6009 RET 22 Return to command mode

Inputs Of The Program:


A = 15
R0 = 10
Theoretical Calculations:
0 0 0 1 01 0 1
00010000
00000101
Outputs:A= 05 OR 7000= 05

ROTATE OPERATIONS:
Program Code: RL
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#12 74 12 Load 12 in accumulator.

6002 RLA A,02 34 Rotate operation performed


twice.

6003 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6006 MOVX @DPTR,A F0 location.
6007 RET 22 Return to command mode

Inputs Of The Program:


A = 12
Outputs:A= 24 OR 7000= 24
Program Code: RR
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#24 74 24 Load 24 in accumulator.

6002 RRA A,01 34 Rotate operation performed

6003 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6006 MOVX @DPTR,A F0 location.
6007 RET 22 Return to command mode

Inputs Of The Program:


A = 24
Outputs:A= 12 OR 7000= 12

Program Code: RLC


MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#82 74 82 Load 82 in accumulator.

6002 RLC A,01 33 Rotate left through carry


operation performed twice.

6003 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6006 MOVX @DPTR,A F0 location.
6007 RET 22 Return to command mode

Inputs of the Program:


A = 82
Outputs:A= 04 OR 7000= 04

Program Code: RRC


MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#24 74 24 Load 24 in accumulator.

6002 RLC A,01 13 Rotate right through carry


operation performed twice.

6003 MOV DPTR,#7000 90 70 00 Set 7000in dptr


Mov content of A into 7000
6006 MOVX @DPTR,A F0 location.
6007 RET 22 Return to command mode

Inputs of The Program:


A = 24
Outputs: A= 12 OR 7000= 12

SWAP OPERATION:

Program Code:
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#12 74 12 Load 12 in accumulator.

6002 SWAP A C4 Swap operation performed


twice.
6007 RET 22 Return to command mode
Inputs Of The Program:
A = 12
Outputs:A= 21
Program Code:complement
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#11 74 11 Load 11 in accumulator.


6002 CPL A F4 Complement operation
performed twice.
6007 RET 22 Return to command mode
Inputs of the Program:
A = 11
Outputs:A= EE
Program Code: Exchange
MNEMONICS
CS:IP Opcode Operands MACHINE CODE COMMENTS

6000 MOV A,#12 74 12 Load 12 in accumulator.


6002 MOV F0,#34 75 F0 34 Load 34 in F0 register
6005 XCH A C5 F0 Exchange operation
performed twice.
6007 RET 22 Return to command mode
Inputs: A = 12 F0= 34
Outputs:A=34 F0=12

2. Time delay Generation Using Timers of 8051.

AIM: Write an ALP to verify timer/counter operation in 8051

MOV SP,#060H

MOV TMOD,#01H

BACK: MOV TL0,#075H

MOV TH0,#0B8H

MOV P1,#0AAH

LCALL SFTDL ACALL DELAY

MOV TL0,#00H

MOV TH0,#00H

MOV P1,#055H

ACALL DELAY
LCALL SFTDL

SJMP BACK

ORG 300H

DELAY: SETB TCON4

AGAIN: JNB TCON5,AGAIN

CLR TCON4

CLR TCON5

RET

SFTDL MOV R4,#10H

DL3 MOV R5,#0FFH

DL2 MOV R6,#0FFH

DL1 DJNZ R6,DL1

DJNZ R5,DL2

DJNZ R4,DL3

RET

RESULT:

INPUT:

OUTPUT:
3. Serial Communication from / to 8051 to / from I/O devices.

AIM: To observe the UART operation in 8051

MOV SP,#060H

MOV IE,#85H

MOV TMOD,#20H

MOV TH1,#0FAH

MOV SCON,#50H

SETB TCON6

RPT: MOV SBUF,#'Y'

HERE: JNB SCON1,HERE

CLR SCON1

MOV A,#'A'

MOV P1,A
SJMP RPT

RET

RESULT:

INPUT:

OUTPUT:

4. Program Using Interrupts to Generate Square Wave 10 KHZ Frequency on P2.1 Using
Timer0 8051 in 8bit Auto reload Mode and Connect a 1HZ Pulse to INT1 pin and Display
on Port0.Assume Crystal Frequency as 11.0592MHZ.

AIM: Write an ALP to verify the interrupt handling in 8051

MAIN MOV SP,#50H

MOV IE,#85H

HERE MOV P1,#7EH

SJMP HERE

ORG 0003H; INT0 ISR

MOV P1,#0AAH

LCALL DELAY

LCALL DELAY

LCALL DELAY

RETI

ORG 0013H; INT1 ISR


MOV P1,#0A5H

LCALL DELAY

LCALL DELAY

RETI

DELAY NOP

MOV R4,#020H

DLY3 MOV R3,#0FFH

DLY2 MOV R2,#0FFH

DLY1 NOP

NOP

DJNZ R2,DLY1

DJNZ R3,DLY2

DJNZ R4,DLY3

RET

RESULT:

INPUT:

OUTPUT:
ADDITIONAL EXPERIMENTS

1. Interfacing tone generator

Aim:-write an ALP to 8086 microprocessor and to generate tone.

Apparatus:
1. 8086 trainer kit.
2. Tone generator kit
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS
1000:0100 START JMP 103 EB 01 90
1000:0103 MOV AX,10FF B8 10 FF
1000:0106 MOV AX,AX 8B E0
1000:0108 PUSH CS 0E
1000:0109 POP DS 1F
1000:010A NOP 90
1000:010B NOP 90
1000:010C NOP 90
1000:010D MOV AL,B6 BD B6
1000:010F MOV BX,8107 BA 8C 07
1000:0112 OUT DX,AL EE
1000:0113 MOV AL,00 B0 00
1000:0115 MOV DX,8C05 BA 8C O5
1000:0118 OUT DX,AL EE
1000:0119 MOV AL,0F B0 0F
1000:011B OUT DX,AL EE
1000:011C MOV CX,0FFF B9 FF FH
1000:011F INT CD,AA CD AA
1000:0121 JMP 100 EB EA

2. Interfacing DAC

Aim:-write an ALP to 8086 microprocessor and DAC

Apparatus:
1. 8086 trainer kit.
2. DAC trainer kit
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV AX,0000 B8 00 00
1000:0103 MOV CS,AX DE C0
1000:0105 MOV SS,AX 8E,C0
1000:0107 MOV AX,11F0 B8 F0 11
1000:010A MOV SP,AX F9 C4
1000:010C PUSH CS DE
1000:010D POP CS 1F
1000:010E MOV AL,81 B0 81
1000:0110 MOV DX,8807 BA 07 88
1000:0113 OUT DX,AL EE
1000:0114 MOV AX,1002 B8 02 01
1000:0117 MOV BX,01E0 B8 E0 01
1000:011A MOV DX,00FF BA FF OO
1000:011D MOV AL,09 B0 89
1000:011F OUT DL,AL EE
1000:0120 INT B9 CD A9
1000:0122 PUSH DX 52
1000:012F MOV AX,1002 CD 89
1000:0131 PUSH DX 52
1000:0132 POP CX 59
1000:0133 MOV DX,8801 BA 01 88
1000:0137 MOV AL,00 B0 00
1000:0139 OUT DX,AL EE
1000:013A PUSH CX 51
1000:013C POP CX 59
1000:013E INC AL FE C0
1000:0140 CMP AL,BL 38 D8
1000:0142 JNZ 139 75 05
1000:0144 OUT DX,AL EE
1000:0145 PUSH CX 51
1000:0146 INT AA CD AA
1000:0148 POP CX 59
1000:0149 DEC AL FE C8
1000:014B JNZ 144 75 F7
1000:014D MOV AH,0012 BH OB
1000:014F INT A1 CD A1
1000:0151 AND A1,FF 24 FF
1000:0153 JZ 137 74 E2
1000:0155 INT A3 CD A3
3. TRAFFIC LIGHT CONTROLLER

Aim:-write an ALP to Traffic light controller.

Apparatus:
1. 8086 trainer kit.
2. Traffic light trainer kit
3. SMPS
4. Keyboard
5. Connecting power cable

Programming Code:

MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS
1000:0100 MOV AL,80 B0 80
1000:0102 MOV DX,B802 BA 07 B8
1000:0105 OUT DX,AL EE
1000:0106 MOV CX,0004 C0 04 00
1000:0109 MOV SI,1200 BE 10 88
1000:010C L1 MOV AL,[SI] 8A 0A
1000:010E MOV DX,8801 BA 10 88
1000:0111 OUT DX,AL EE
1000:0112 INC SI,1200 46
1000:0113 MOV AL,[SI] 8A 04
1000:011C MOV DX,8801 BA 0A 88
1000:011F OUT DX,AL EE
1000:0120 INC SI 46
1000:0124 MOV AL,[SI] BA 01
1000:0128 MOV DX,8801 BA 0A 88
1000:0129 OUT DX,AL EE
1000:012A INC SI 46
1000:012B MOV AL,[SI] 8A 04
1000:012D MOV DX,8803 BA D3 88
1000:0130 OUT DX,AL EE
1000:0132 MOV [SI],AL 8A CA
1000:0134 MOV DX,8805 BA 05 88
1000:0138 INC SI 46
1000:0139 CALL 0500 E8 14 05
1000:013C DEC CX 49
1000:013D JNZ L1 75 CD
1000:013F JNZ 106 7A C5

LONGER DELAY:
MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS

1000:0800 MOV BX,FFFF BB FF FF

1000:0803 NOP 90

1000:0804 NOP 90

1000:0805 NOP 90

1000:0806 DEC 4B

1000:0807 JNZ 0803 75 FF

1000:0809 RET C3

SHORTEST DELAY:
MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS
1000:0500 MOV BX,BFFF BX FF 0F
1000:0503 NOP 90
1000:0504 NOP 90
1000:0505 NOP 90
1000:0506 DEC CX
1000:0507 JNZ 0503 C3
4. SRAM/DRAM

Aim:-write an ALP to SRAM/DRAM

Apparatus:
1. 8086 trainer kit.
2. SRAM/DRAM trainer kit
3. SMPS
4. Keyboard
5. Connecting power cable

Procedure for SRAM /DRAM

1. Keep the per ware 1 on the left side of the kit connect through 50 pin FRC
2. Enter the Software code a given in the accompanying sheets (list)
3. Make switch SI towards you to enable signal Stepping of every access including INTA cycle
4. The 16-bit ADD 002A is to be assigned to the report
--> Connect the decoder B8 pins A.B.C. to address lines AB, AC, AD respectively
→ connect ENABLE pins G2A,G2B address line AE, AF
→ Use I0/M line tags to ENABLE PIN G of decode 138, so whenever I/O is being selectedthe
decoder is enabled (active high I0)
5. Connect O/P pin Yo of decoder to the ENDL TAGof the Buffer 245 to ENABLE the port.
6) Connect the DIR tag of buffer (IC. 07) to the GND while writing to the port
7) Load the program as given in the list 1 and execute it as.

Press G =CRCR21568 DCR->0100>CR

DATA BOS I/O PORT ADDR BUS COMMENTS


START C9 C9 00 DATA BUFFER IS
DISABLE

STEP1 Control Ret to command mode without disturbing display

Programming Code:

MNEMONICS
CS:IP LABEL MACHINE CODE
OPCODE OPERANDS

1000:0100 START JMP 103 EB 01 90


1000:0103 MOV AX,10FF B8 10 FF
1000:0106 MOV SP,AX 8B E0
1000:0109 PUSH CS 0E
1000:010A POP AX,10FF 58
1000:010C NOP 90
1000:010D NOP 90
1000:010E NOP 90
1000:010F MOV AL,0C9H 32 C9
1000:0111 MOV DX,002AH BA 00 2A
1000:0114 OUT DX,AL EC
1000:0115 INT A4 CD A4

You might also like