Microprocessor and Microcontroller Lab

BRANCH: Electronics and Communication Engineering

SEMESTER: 5th SEM

SUBJECT: Microprocessor and Microcontroller Lab

INDEX

S. No

Name of the Practical

1

WALP to add and subtract two 8 bit and 16 bit nos.

2

WALP to multiply two 8 bit and 16 bit nos.

3

WALP to divide two 8 bit and 16 bit nos.

4

WALP to add a series of five 8-bit nos.

5

WALP to find odd and even number from a given group of nos.

6

WALP to find positive and negative number from a given group of nos.

7

WALP to find largest and smallest number and store the result in Accumulator

8

WALP for arranging in ascending and descending order of given 5 numbers 

9

WALP for interfacing of 8255 Programming Peripheral Interface (PPI) with 8086 

10

WALP to add two 8 bit nos. using 8051 microcontroller

Experiment 1

Aim: WALP to add and subtract two 8 bit and 16 bit nos.

Tool Required: Dyna Trainer Kit

Program:

(a) Addition of two 8 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

1000:2000

This specifies the segment and offset (effective address)

1000:2000

MOV

AL,23

Load the 8 bit no.23 into 8 bit register AL

1000:2002

MOV

BL,54

Load the 8 bit no.54 into 8 bit register BL

1000:2004

ADD

AL,BL

Add the contents of register AL and BL and store the result in register AL

1000:2006

INT

3

Interrupt the current operation.

1000:2007

 

 

Press Enter

Dyna_86>

G

1000:2000 and press Enter

 

Break at

0FFF: 1007

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0077, BX=0054, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2007, FL=F006

Conclusion:

1. In each instruction, offset address is incremented by 2 bit because 1 address is occupied by instruction and the other saves the data.

2. If AL is replaced by AH then the output will be

AX= 7700, BX=0054, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2007, FL=F006

3. If BL is replaced by BH then the output will be

AX= 0077, BX=5400, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2007, FL=F006


 

(b) Addition of two 16 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

1000:2000

This specifies the segment and offset (effective address)

1000:2000

MOV

AX,A2C6

Load the 16 bit no.A2C6 into 16 bit register AX

1000:2003

MOV

BX,3C36

Load the 16 bit no.3C36 into 16 bit register BX

1000:2006

ADD

AX,BX

Add the contents of register AX and BX and store the result in register AX

1000:2008

INT

3

Interrupt the current operation.

1000:2009

 

 

Press Enter

Dyna_86>

G

1000:2000 and press Enter

 

Break at 2009

0FFF: 1009

 

 

Dyna_86>

R

 

 

 

Result:

AX= DEFC, BX=3C36, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2009, FL=F086

Conclusion:

In each instruction, offset address is incremented by 3 bits because 1 address is occupied by instruction and the rest two saves the data.

(c) Subtraction of two 8 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

1000:2000

This specifies the segment and offset (effective address)

1000:2000

MOV

AL,44

Load the 8 bit no.44 into 8 bit register AL

1000:2002

MOV

BL,22

Load the 8 bit no.22 into 8 bit register BL

1000:2004

SUB

AL,BL

Subtract the contents of register AL and BL and store the result in register AL

1000:2006

INT

3

Interrupt the current operation.

1000:2007

 

 

Press Enter

Dyna_86>

G

1000:2000 and press Enter

 

Break at

0FFF: 1007

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0022, BX=0022, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2007, FL=F006

Conclusion:

In each instruction, offset address is incremented by 2 bit because 1 address is occupied by instruction and the other saves the data.

(b) Subtraction of two 16 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

1000:2000

This specifies the segment and offset (effective address)

1000:2000

MOV

AX,4321

Load the 16 bit no.4321 into 16 bit register AX

1000:2003

MOV

BX,1234

Load the 16 bit no.1234 into 16 bit register BX

1000:2006

SUB

AX,BX

Subtract the contents of register AX and BX and store the result in register AX

1000:2008

INT

3

Interrupt the current operation.

1000:2009

 

 

Press Enter

Dyna_86>

G

1000:2000 and press Enter

 

Break at 2009

0FFF: 1009

 

 

Dyna_86>

R

 

 

 

Result:

AX= 30ED, BX=1234, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000, IP=2009, FL=F086

Conclusion:

In each instruction, offset address is incremented by 3 bits because 1 address is occupied by instruction and the rest two saves the data.


 

Experiment 2

Aim: WALP to multiply two 8 bit and 16 bit nos.

Tool Required: Dyna Trainer Kit

Program:

(a) Multiplication of two 8 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,07

Load the 8 bit no.07 into 8 bit register AL

2000:1002

MOV

BL,08

Load the 8 bit no.08 into 8 bit register BL

2000:1004

MUL

BL

Multiply the contents of register AL and BL and store the result in register AL

2000:1006

INT

3

Interrupt the current operation.

2000:1007

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 1007

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0038, BX=0008, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000

Conclusion:

In each instruction, offset address is incremented by 2 bit because 1 address is occupied by instruction and the other saves the data.


 

(b) Multiplication of two 16 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AX,09

Load the 16 bit no.09 into 16 bit register AX

2000:1003

MOV

BX,05

Load the 16 bit no.05 into 16 bit register BX

2000:1006

MUL

BX

Add the contents of register AX and BX and store the result in register AX

2000:1008

INT

3

Interrupt the current operation.

2000:1009

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 1009

 

 

Dyna_86>

R

 

 

 

Result:

AX= 002D, BX=0005, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000

Conclusion:

In each instruction, offset address is incremented by 3 bits because 1 address is occupied by instruction and the rest two saves the data.


 

Experiment 3

Aim: WALP to divide two 8 bit and 16 bit nos.

Tool Required: Dyna Trainer Kit

Program:

(a) Division of two 8 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,09

Load the 8 bit no.09 into 8 bit register AL

2000:1002

MOV

BL,05

Load the 8 bit no.05 into 8 bit register BL

2000:1004

DIV

BL

Dividing the contents of register AL by contents of register BL and store the result in register AL

2000:1006

INT

3

Interrupt the current operation.

2000:1007

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 1007

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0401, BX=0005, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000

Conclusion:

In each instruction, offset address is incremented by 2 bit because 1 address is occupied by instruction and the other saves the data.


 

(b) Division of two 16 bit numbers

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AX,0020

Load the 16 bit no.0020 into 16 bit register AX

2000:1003

MOV

BX,0003

Load the 16 bit no.0003 into 16 bit register BX

2000:1006

DIV

BX

Dividing the contents of register AX by the contents of register BX and store the result in register AX

2000:1008

INT

3

Interrupt the current operation.

2000:1009

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 1009

 

 

Dyna_86>

R

 

 

 

Result:

AX= 000A, BX=0002, CX=0000, DX=0000, SP=06FD, BP=0000, SI=0000

Conclusion:

In each instruction, offset address is incremented by 3 bits because 1 address is occupied by instruction and the rest two saves the data.

Experiment 4

Aim: WALP to add a series of five 8-bit nos.

Tool Required: Dyna Trainer Kit

Program:

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,23

Load the 8 bit no.23 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,12

Load the 8 bit no.12 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,34

Load the 8 bit no.34 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,44

Load the 8 bit no.44 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,68

Load the 8 bit no.68 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CL,05

Set a counter CL to value 5

2000:101B

MOV

AL,00

Clear any previous value and reset the AL register to 0

2000:101F

MOV

SI,2000

Set the register SI to location 2000

2000:1022

MOV

BL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1024

ADD

AL,BL

Add the contents of register BL and AL and store the data in AL

2000:1026

INC

SI

Increment the value of SI by 1

2000:1027

DEC

CL

Decrement the value of counter CL by 1

2000:1029

JNZ

1022

This will fetch the next instruction from the address 1022 if CL is not equal to 0

2000:102B

INT

3

Interrupt the current operation.

2000:102C

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 102C

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0035, BX=0068, CX=0000, DX=0000, SP=06FD, BP=0000, SI=2004, IP=1026, FL=F047


Experiment 5

Aim: WALP to find odd and even number from a given group of nos.

Tool Required: Dyna Trainer Kit

Program:

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,01

Load the 8 bit no.01 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,02

Load the 8 bit no.02 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,03

Load the 8 bit no.03 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,04

Load the 8 bit no.04 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,05

Load the 8 bit no.05 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CL,05

Set a counter CL to value 5

2000:101B

MOV

AL,00

Clear any previous value and reset the AL register to 0

2000:101D

MOV

SI,2000

Set the register SI to location 2000

2000:1020

MOV

BL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1022

RCR

BL,01

Rotate Carry Right Operation is performed  to the value stored in register BL

2000:1024

JC

102A

Jump to the location 102A if Carry  Equal to Zero

2000:1026

INC

AL

Increment the value of DH by 1

2000:1028

JMP

102C

Jump to memory location 102C

2000:102A

INC

DL

Increment the DL value by 1

2000:102C

INC

SI

Increment the SI value by 1

2000:102D

DEC

CL

Decrement the Counter value by 1

2000:102F

JNZ

1020

Jump to the memory location 1020 if CL is not equal to zero

2000:1031

INT

3

Interrupt the current operation.

2000:1032

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1032

 

 

Dyna_86>

R

 

 

 

Result:

In this program we are finding even and odd no. from a given group of 5 numbers. The O/P generated is AX= 0002, BX=0002, CX=0000, DX=0003, SP=06FD, BP=0000, SI=2005, IP=1034, FL=F047. AX stores even number and DX stores odd number.


 

Experiment 6

Aim: WALP to find positive and negative number from a given group of nos.

Tool Required: Dyna Trainer Kit

Program:

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,48

Load the 8 bit no.48 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,57

Load the 8 bit no.57 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,69

Load the 8 bit no.69 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,A7

Load the 8 bit no.A7 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,A6

Load the 8 bit no.A6 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CL,05

Set a counter CL to value 5

2000:101B

MOV

AL,00

Clear any previous value and reset the AL register to 0

2000:101D

MOV

SI,2000

Set the register SI to location 2000

2000:1020

MOV

AL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register AL

2000:1022

AND

AL,80

AND 80 to the value stored in register AL

2000:1024

JNZ

102A

Jump to the location 102A if Not Equal to Zero

2000:1026

INC

DH

Increment the value of DH by 1

2000:1028

JMP

102C

Jump to memory location 102C

2000:102A

INC

DL

Increment the DL value by 1

2000:102C

INC

SI

Increment the SI value by 1

2000:102D

DEC

CL

Decrement the Counter value by 1

2000:102F

JNZ

1020

Jump to the memory location 1020 if CL is not equal to zero

2000:1031

INT

3

Interrupt the current operation.

2000:1032

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1032

 

 

Dyna_86>

R

 

 

 

Result:

In this program we are finding positive and negative no. from a given group of 5 numbers. The O/P generated is AX= 0080, BX=0000, CX=0000, DX=0302, SP=06FD, BP=0000, SI=2005. DH stores positive number and DL stores negative number.

Experiment 7

Aim: WALP to find largest and smallest number and store the result in Accumulator

Tool Required: Dyna Trainer Kit

Program:

(a) ALP to find the largest number

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,40

Load the 8 bit no.40 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,61

Load the 8 bit no.61 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,75

Load the 8 bit no.75 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,C7

Load the 8 bit no.C7 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,20

Load the 8 bit no.20 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CL,04

Set a counter CL to value 4

2000:101B

MOV

SI,2000

Set the register SI to location 2000

2000:101E

MOV

DI,2001

Set the register DI to location 2001

2000:1021

MOV

AL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register AL

2000:1023

MOV

BL,[DI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1025

CMP

AL,BL

Compare the contents of Register AL and BL

2000:1027

JNC

102F

Jump to the memory location 102F if Carry is not generated

2000:1029

XCHG

AL,BL

Exchange the values of AL and BL if carry is generated

2000:102B

MOV

[SI],AL

Copy the contents of register AL to the memory location stored by register SI

2000:102D

MOV

[DI],BL

Copy the contents of register BL to the memory location stored by register DI

2000:102F

INC

DI

Increment the register DI value by 1

2000:1030

DEC

CL

Decrease the CL value by 1

2000:1032

JNZ

1021

Jump to the memory location 1021 if CL is not equal to zero

2000:1034

INT

3

Interrupt the current operation.

2000:1035

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1035

 

 

Dyna_86>

R

 

 

 (b) ALP to find the smallest number

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,51

Load the 8 bit no.51 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,A5

Load the 8 bit no.A5 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,75

Load the 8 bit no.75 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,C7

Load the 8 bit no.C7 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,20

Load the 8 bit no.20 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CL,04

Set a counter CL to value 4

2000:101B

MOV

SI,2000

Set the register SI to location 2000

2000:101E

MOV

DI,2001

Set the register DI to location 2001

2000:1021

MOV

AL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register AL

2000:1023

MOV

BL,[DI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1025

CMP

AL,BL

Compare the contents of Register AL and BL

2000:1027

JC

102F

Jump to the memory location 102F if Carry is generated

2000:1029

XCHG

AL,BL

Exchange the values of AL and BL if carry is generated

2000:102B

MOV

[SI],AL

Copy the contents of register AL to the memory location stored by register SI

2000:102D

MOV

[DI],BL

Copy the contents of register BL to the memory location stored by register DI

2000:102F

INC

DI

Increment the register DI value by 1

2000:1030

DEC

CL

Decrease the CL value by 1

2000:1032

JNZ

1021

Jump to the memory location 1021 if CL is not equal to zero

2000:1034

INT

3

Interrupt the current operation.

2000:1035

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1035

 

 

Dyna_86>

R

 

 

 

Result:

The O/P generated for finding the largest number program is AX= 00C7, BX=0020, CX=0000, DX=0000, SP=06FD, BP=0000, SI=2000, and, for finding the smallest number program is AX= 0020, BX=0020, CX=0000, DX=0000, SP=06FD, BP=0000, SI=2000


 

Experiment 8

Aim: WALP for arranging in ascending and descending order of given 5 numbers 

Tool Required: Dyna Trainer Kit

Program:

(a) ALP to arrange in ascending order

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,B1

Load the 8 bit no.B1 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,95

Load the 8 bit no.95 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,A5

Load the 8 bit no.A5 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,61

Load the 8 bit no.61 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,D7

Load the 8 bit no.D7 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CH,04

Set a counter CH to value 4

2000:101B

MOV

SI,2000

Set the register SI to location 2000

2000:101E

MOV

DX,2001

Set the register DX to location 2001

2000:1021

MOV

DI,DX

Move the contents of register DX to DI

2000:1023

MOV

CL,CH

Move the contents of register CH to CL

2000:1025

MOV

AL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register AL

2000:1027

MOV

BL,[DI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1029

CMP

AL,BL

Compare the contents of Register AL and BL

2000:102B

JC

1033

Jump to the memory location 1033 if Carry is generated

2000:102D

XCHG

AL,BL

Exchange the values of AL and BL if carry is generated

2000:102F

MOV

[SI],AL

Copy the contents of register AL to the memory location stored by register SI

2000:1031

MOV

[DI],BL

Copy the contents of register BL to the memory location stored by register DI

2000:1033

INC

DI

Increment the register DI value by 1

2000:1034

DEC

CL

Decrease the CL value by 1

2000:1036

JNZ

1025

Jump to the memory location 1025 if CL is not equal to zero

2000:1038

INC

SI

Increment the register SI value by 1

2000:1039

INC

DX

Increment the register DX value by 1

2000:103A

DEC

CH

Decrement the register CH value by 1

2000:103C

JNZ

1021

Jump to the memory location 1021 if CL is not equal to zero

2000:103E

MOV

AL,[2000]

Move the contents of location [2000] to register AL

2000:1041

MOV

BL,[2001]

Move the contents of location [2001] to register BL

2000:1045

MOV

CL,[2002]

Move the contents of location [2002] to register CL

2000:1049

MOV

DL,[2003]

Move the contents of location [2003] to register DL

2000:104D

MOV

DH,[2004]

Move the contents of location [2004] to register DH

2000:1051

INT

3

Interrupt the current operation.

2000:1052

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1052

 

 

Dyna_86>

R

 

 

 

Result:

AX= 0061, BX=0095, CX=00A5, DX=D7B1, SP=06FD, BP=0000, SI=2004

Conclusion:

The ascending order is: AL=61         BL=95             CL=A5                        DL=B1            DH=D7

 

(b) ALP to arrange in descending order

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

This specifies the segment and offset (effective address)

2000:1000

MOV

AL,B1

Load the 8 bit no.B1 into 8 bit register AL

2000:1002

MOV

[2000], AL

Load the value of 8 bit register AL into memory location [2000]

2000:1005

MOV

AL,95

Load the 8 bit no.95 into 8 bit register AL

2000:1007

MOV

[2001], AL

Load the value of 8 bit register AL into memory location [2001]

2000:100A

MOV

AL,A5

Load the 8 bit no.A5 into 8 bit register AL

2000:100C

MOV

[2002], AL

Load the value of 8 bit register AL into memory location [2002]

2000:100F

MOV

AL,61

Load the 8 bit no.61 into 8 bit register AL

2000:1011

MOV

[2003], AL

Load the value of 8 bit register AL into memory location [2003]

2000:1014

MOV

AL,D7

Load the 8 bit no.D7 into 8 bit register AL

2000:1016

MOV

[2004], AL

Load the value of 8 bit register AL into memory location [2004]

2000:1019

MOV

CH,04

Set a counter CH to value 4

2000:101B

MOV

SI,2000

Set the register SI to location 2000

2000:101E

MOV

DX,2001

Set the register DX to location 2001

2000:1021

MOV

DI,DX

Move the contents of register DX to DI

2000:1023

MOV

CL,CH

Move the contents of register CH to CL

2000:1025

MOV

AL,[SI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register AL

2000:1027

MOV

BL,[DI]

Load the data saved in SI, i.e., data at the address saved at SI into 8 bit register BL

2000:1029

CMP

AL,BL

Compare the contents of Register AL and BL

2000:102B

JNC

1033

Jump to the memory location 1033 if Carry is not generated

2000:102D

XCHG

AL,BL

Exchange the values of AL and BL if carry is generated

2000:102F

MOV

[SI],AL

Copy the contents of register AL to the memory location stored by register SI

2000:1031

MOV

[DI],BL

Copy the contents of register BL to the memory location stored by register DI

2000:1033

INC

DI

Increment the register DI value by 1

2000:1034

DEC

CL

Decrease the CL value by 1

2000:1036

JNZ

1025

Jump to the memory location 1025 if CL is not equal to zero

2000:1038

INC

SI

Increment the register SI value by 1

2000:1039

INC

DX

Increment the register DX value by 1

2000:103A

DEC

CH

Decrement the register CH value by 1

2000:103C

JNZ

1021

Jump to the memory location 1021 if CL is not equal to zero

2000:103E

MOV

AL,[2000]

Move the contents of location [2000] to register AL

2000:1041

MOV

BL,[2001]

Move the contents of location [2001] to register BL

2000:1045

MOV

CL,[2002]

Move the contents of location [2002] to register CL

2000:1049

MOV

DL,[2003]

Move the contents of location [2003] to register DL

2000:104D

MOV

DH,[2004]

Move the contents of location [2004] to register DH

2000:1051

INT

3

Interrupt the current operation.

2000:1052

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF:1052

 

 

Dyna_86>

R

 

 

 

Result:

AX= 00D7, BX=00B1, CX=00A5, DX=6195, SP=06FD, BP=0000, SI=2004

Conclusion:

The descending order is: AL=D7       BL=B1                        CL=A5                        DL=95             DH=61

Experiment 9

Aim: WALP for interfacing of 8255 Programming Peripheral Interface (PPI) with 8086 

Tool Required: Dyna Trainer Kit

Features of 8255:

The 8255A is a programmable peripheral interface (PPI) device designed for use in Intel microcomputer systems. Its function is that of a general purposes I/O component to Interface peripheral equipment to the microcomputer system bush. 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. The important features are:

·         3 8-bit IO ports PA, PB, PC

  • PA can be set for Modes 0, 1, 2. PB for 0,1 and PC for mode 0 and for BSR. Modes 1 and 2 are interrupt driven.
  • PC has 2 4-bit parts: PC upper (PCU) and PC lower (PCL), each can be set independently for I or O. Each PC bit can be set/reset individually in BSR mode.
  • PA and PCU are Group A (GA) and PB and PCL are Group B (GB)
  • Address/data bus must be externally demux'd.
  • TTL compatible.
  • Improved dc driving capability

Pin Diagram of 8255

Block Diagram of 8255

 Program:

Address

Opcode

Operand

Comment

Dyna_86>

A

2000:1000

 

2000:1000

MOV

AL,90

Load the 8 bit no.90 into 8 bit register AL

2000:1002

OUT

33,AL

At CWR (address 33) we are putting the data of AL. CWR

1

0

0

1

0

0

0

0

2000:1004

IN

AL,30

Port A (address 30)is acting as input to AL

2000:1006

OUT

31,AL

Data from AL is sent to PB. So PB is Output Port

2000:1008

INT

3

Interrupt the current operation.

2000:1009

 

 

Press Enter

Dyna_86>

G

2000:1000 and press Enter

 

Break at

1FFF: 1009

 

 

Dyna_86>

R

 

 

 

Result: Data on Port A is PA0-PA7 is 10010000. Data on Port B is PB0-PB7 is 10010000. So equal data is observed.


 

 Experiment 10

Aim: WALP to add two 8 bit nos. using 8051 microcontroller

Tool Required: Dyna Trainer Kit

Program:

Address

Opcode

Operand

Comment

Dyna_51>

A

9402

 

9402:

MOV

A,#06

# means immediate data. So no.06 will be copied to A

9404:

MOV

R0,#05

No.05 will be copied to R0

9406:

ADD

A,R0

Add the contents of register A and R0 and store the result in register A

9407:

JUMP

6000

Instruction to Terminate the program

 

 

 

Press Enter

Dyna_51>

T

9402

It means trace the location 9402 and start the execution of the program step by step

 

Result:

A= 0B, PSW=01, SP=4A, DPTR=836B, PC=1770

Reference:-

  • https://ggnindia.dronacharya.info/ECE/Downloads/Labmanuals/AUG09_DEC09/V_Sem/MICROPROCESSOR_lab_VthSem_ECE.pdf
  • https://webstor.srmist.edu.in/web_assets/srm_mainsite/files/2017/cse-lab-manual-microprocessor.pdf
  • https://www.iare.ac.in/sites/default/files/lab1/IARE_CSE_MPI_LAB_MANUAL.pdf
  • https://www.gopalancolleges.com/gcem/course-material/ece/manuals/sem-VI/Microprocessor-lab-manual-10ECL68.pdf
  •  http://www.cittumkur.org/divi/wp-content/uploads/2017/06/MP-LAB-MANUAL-2015.pdf
  • https://docplayer.net/94967547-Microfriend-dyna-86l-lcd-user-s-manual.html
  • https://aggarwalvipul.files.wordpress.com/2018/04/mil-final-manual_2012_2015.pdf

 

 

Comments

Popular posts from this blog

8086 pins configuration

Architecture of 8086

Assignment Questions (Subject:- Microprocessor and Microcontroller)