Está en la página 1de 45

EXPERIMENT NO.

1
TITLE: ADDITION AND SUBTRACTION OF TWO 16 BIT NOS.

AIM: To write an assembly language program to add and subtract 16 bit number.

APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE: a) Addition of 16 bit number

i) Store first 16 bit number in HL pair.


ii) Exchange the content of DE pair and HL pair to store the first
number.
iii) Store second 16 bit in HL pair.
iv) Addition of 1st and 2ndnumber.
v) Store result in 7085 location.

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 2A 01 75 LHLD 7501 Load the content of HL

7003 EB XCHG Content of HL pair exchange with DE

7004 2A 03 75 LHLD 7503 Load the IInd16 bit number in HL

7007 19 DAD D The content of DE pair added with content of HL


pair.
7008 22 05 75 SHLD 7505 Store the LSB of Sum in 7505 and MSB in 7506.

700B 76/CF HLT Terminate the program

Monitor Program – A program stored in the ROM BIOS (Read Only Memory Basic Input
Output System) for controlling the overall operations of the kit. It is similar to the Operating
system on a Computer (PC).
RESULT:

Input: Output:
7501:25 H
7502:12 H 7505:57 (LSB)
7503:32 H
7504: 13 H 7506:25 (MSB)

CONCLUSION: The addition of two 16 bit numbers is performed using 8085

microprocessor.
PROCEDURE: b) To subtract two 16 bit number

i) Store first 16 bit number in HL pair.


ii) Exchange the content of DE pair and HL pair to store the first
number.
iii) Store second 16 bit in HL pair.
iv) Load lower byte in accumulator.
v) Subtract the lower byte of second number.
vi) Store the result
vii) Load higher byte in accumulator.
viii) Subtract the higher byte of second number.
ix) Store the result.
x) Store the result at memory location 7040.

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 2A 20 70 LHLD 7020 H Load the 1 st no. in HL

7003 EB XCHG Content of HL pair exchange with DE

7004 2A 22 70 LHLD 7022 H Load the IInd16 bit number in HL

7007 7B MOV A,E Load lower byte of 1st in A.

7008 9D SBB L Subtract lower byte of 2nd no.

7009 6F MOV L,A Store the result in reg L.

700A 7A MOV A,D Load higher byte of 1st no in A

700B 9C SBB H Subtract higher byte of 2nd no with lower borrow


of previous subtraction.
700C 67 MOV H,A Store the result in H reg.

700D 22 40 70 SHLD 7040 Store 16 bit result in memory location 7040

700E 76 HLT Stop


FLOWCHART:

Start

Get the first number

Get the second number

Subtract

Store the result

Stop

RESULT:

Input : Output:
7020 :34 H 7040: 00 H
7021: 45 H 7041: 33 H
7030: 34 H
7031 : 12 H

CONCLUSION: Zero Flag is reset as result is not zero parity flag is set as result contain even

one sign flag is reset as result has MSB bit zero.


EXPERIMENT NO.2

TITLE: ADDITION AND SUBTRACTION OF TWO 32 BIT NOS.

AIM: To write an assembly language program to add and subtract 32 bit number.

APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE: a) Addition of 32 bit number

We have to use LDA instruction as it load data into accumulator from specified
memory location.
i) Load the number to 6000 H location
ii) Exchange the content with DE pair
iii) Load the number at 60002 H location
iv) Exchange the content with DE pair
v) Same above step perform to load the second 32 bit number at a
given location.
vi) Copy the result at 600A,600B,600C,600D H.

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 2A 00 60 LHLD 6000H Load the 1 st no. (Lower byte) 16 bit no.in HL

7003 EB XCHG Content of HL pair exchange with DE

7004 2A 02 60 LHLD 6002 H Load the Istno.(Upper byte)16 bit number in HL

7007 EB XCHG Content of HL pair exchange with DE

7008 3A 04 60 LDA 6004 H Load accumulator with content

700B 4F MOV C,A Move the content of Accumulator to C register.

700C 3A 05 60 LDA 6005 H Load lower byte of II nd no. in A

700F 47 MOV B,A Move content of A to B

7010 09 DAD B Addition of HL and BC register store result at


HL
7011 22 0A 60 SHLD 600A Store 16 bit result in memory location 600A

7014 EB XCHG Exchange content of HL with DE

7015 3A 06 60 LDA 6006 H Load content of location 6006 at accumulator

7018 4F MOV C,A C A

7019 3A 07 60 LDA 6007 H Load content of location 6007 at accumulator

701C 47 MOV B,A B A

701D 09 DAD B Addition of HL and BC register store result at


HL
702E 22 0C 60 SHLD 600C Store 16 bit result in memory location 600C

7021 CF RST 1 Terminate the program


X

Flowchart:
BC2nd 16 bit no.

Start
Add two 16 Bit no.(HL
+BC)

Store the 2 32 bit no.in Result in HL


memory location

Store in memory Lower 16 bit


Start to pick up first 16 bit no.

HL  DE

HL 16 bit no.


HL 2nd 16 bit no.

Exchange no of HL with DE
Load Acc. With first upper byte

HL 2nd 16 bit no.


C A

Load Acc. With second upper byte


Exchange no of HL with DE

B A
Load Accumulator with second
Lower byte
BC 16 bit no.

C A
Add the 1st 16 bit no.

Result in HL
Load Accumulator with second
higher byte
Store in memory Upper 16 bit

B A

Stop
X
RESULT:

Input Output
6000 : AC 600A: D0
6001 : BE 600B: 51
6002: 95 600C: DA
6003: C8 600D: B2
6004: 24
6005: 93
6006: 45
6007: EA

CONCLUSION: The addition of two 32 bit numbers is performed using 8085

microprocessor.
PROCEDURE: b) Subtraction of 32 bit number

i) Load the 1st number (lower byte)at location 6000 H.


ii) Move the content to the B register.
iii) Load the 2nd number (Lower Byte) at location 6004 H.
iv) Subtract the first number with the second number, if during subtraction
borrow is taken then use the SBB instruction.
v) Continue the same process for the whole number series i.e first upper and
lower byte / second upper and lower byte.
vi) Store the result at location 600A, 600B, 600C and 600D.

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 21 00 60 LXI H ,6000H Load content from location 6000H
7003 7E MOV A,M A M
7004 47 MOV B,A B A
7005 21 04 60 LXI H ,6004 Load content from location 6004H
7008 7E MOV A,M A M
7009 90 SUB B A- B
700A 32 0A 60 STA 600A Store the result at location 600A
700D 21 01 60 LXI H, 6001 Load content from location 6001H
7010 7E MOV A,M A M
7011 47 MOV B,A BA
7012 21 05 60 LXI H 6005 Load content from location 6005H
7015 7E MOV A,M A M
7016 98 SBB B If borrow generates shift to the next content
7017 32 0B 60 STA 600B Store the result at location 600B
701A 21 02 60 LXI H ,6002 Load content from location 6002H
701D 7E MOV A,M A M
701E 47 MOV B,A BA
701F 21 06 60 LXI H 6006 Load content from location 6006H
7022 7E MOV A,M A M
7023 98 SBB B If borrow generates shift to the next content
7024 32 0C 60 STA 600C Store the result at location 600C
7027 21 03 60 LXI H 6003 Load content from location 6003H
702A 7E MOV A,M A M
702B 47 MOV B,A B A
702C 21 07 60 LXI H, 6007 Load content from location 6007H
702F 7E MOV A,M A M
7030 98 SBB B If borrow generates shift to the next content
7031 32 0D 60 STA 600D Store the result at location 600D
7034 CF RST 1 Terminate the program

FLOWCHART:
RESULT:

Input : Output:
6000:24 600A:78
6001: 93 600B: D4
6002:45 600C: AF
6003:EA 600D: 21
6004:AC
6005:BE
6006: 95
6007: C8

EA 24 93 45
C8 95 BE AC
21 AF D4 78

CONCLUSION: The subtraction of two 32 bit numbers is performed using 8085


microprocessor.
EXPERIMENT NO.3

TITLE: MULTIPLICATION OF 8 BIT NUMBER BY SUCCESSIVE ADDITION AND


LEFT SHIFT AND ADD METHOD

AIM: To write an assembly language program to multiply two 8 bit number by successive
addition and left shift method.

APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE:

i) Load two 8 bit data one in accumulator and another in register.


ii) Add the HL pair with specified requirement.
iii) Decrement the C register.
iv) Repeat this process till counter is not zero.
v) Store the result in memory.

PROGRAM:

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
6000 06 15 MVI B,15 H Load reg B with 15 H

6002 0E 03 MVI C, 03 H Load reg C with 03 H

6004 80 Here ADD B Add reg B with A

6005 0D DCR C Decrement C

6006 C2 04 60 JNZ Here Jump if not zero to 6004

6009 67 MOV H, A Move data from A to M

600A 32 30 70 STA 7030 H Store result at 7030

600D CF RST 1 Return to command mode


FLOWCHART:

Start

Get the first number

Initialize second number


as a counter

Result =0

Result =Result + First Number

Decrement counter

NO
If count =0

Store result to 7030 H

Stop
RESULT:

Input : Output:

Reg B: 15 H A=A+B

RegC : 03 H 15+15=30

Due to loop A= 30+15

=45

CONCLUSION: The result of 8 bit multiplication is store at 7030 H location. Thus we perform

the 8 bit multiplication.


EXPERIMENT NO .4

TITLE: DIVISION OF 16 BIT NUMBER BY 8 BIT NUMBER

AIM: To write an assembly language program to divide 16 bit number by 8 bit no .

APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE:

i) Divide 16 bit number stored in memory locations 6600H and 6601H by


the 8 bit number stored at memory location 6602H.
ii) Store the quotient in memory locations 6300H and 6301H and
remainder in memory locations 6302H and 6303H.

PROGRAM:-

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 2A0066 LHLD 6600 H Get the dividend
7003 3A0266 LDA 6602 H Get the divisor
7006 4F MOV C,A C A
7007 110000 LXI D , 0000H Quotient =0
700A 7D Back MOV A,L AL
700B 91 SUB C Subtract divisor
700C 6F MOV L,A L A
700D D21170 JNC SKIP If CY 1 then jump
7010 25 DCR H Subtract borrow of previous subtraction
7011 13 Skip INX D Increment quotient
7012 7C MOV A,H AH
7013 FE00 CPI, 00 Check if dividend < divisor
7015 C20A70 JNZ BACK If no repeat
7018 7D MOV A,L A L
7019 B9 CMP C Compare the content
701A D20A70 JNC BACK If CY 1 then jump
701D 220263 SHLD 6302H Store the remainder at location 6302 H
7020 EB XCHG Exchange the data
7021 220063 SHLD 6300 H Store the quotient at location 6300 H
7024 CF RST 1 Terminate the program

FLOWCHART:
RESULT:

Input: Output:

6600H = 60H 6300 H:E8


6601H = A0H 6301 H:08
6602H = 12H 6302 H:10
6303 H:00

CONCLUSION: The result of division is store at 6300 H location. Thus we perform the division of

16bit number by 8 bit number.


EXPERIMENT NO. 5

TITLE: FIND THE FACTORIAL OF A GIVEN NUMBER

AIM: To write an assembly language program to find factorial of given number.

APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE:

i) Load the content at register B.


ii) Move the content from B to C reg.
iii) Decrement the counter.
iv) Move the content of counter to E register.
v) Subtract the content of Accumulator and add to the B register.
vi) Check the result whether it is zero or not ,if not zero again do the same
step no (v)
vii) Move the content of Accumulator to B register.
viii) Jump if not zero to step no iv
ix) Store the result at location 6000H.

PROGRAM:

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 06 ,05 MVI B,05 Load the content to reg.B
7002 48 MOV C,B CB
7003 0D DCR C Decrement counter 1 time
7004 59 UP MOV E,C E C
7005 9F SUB A Subtract the content and store it accumulator
7006 80 AGAIN ADD B Add the content of B register
7007 1D DCR E Decrement the counter second time
7008 C2 06 70 JNZ AGAIN Jump if not zero to location 7006 H
700B 47 MOV B,A B A
700C 0D DCR C Decrement the counter again
700D C2 04 70 JNZ UP Again see if not zero jump to location 7004 H
7010 32 00 60 STA 6000 H Store the result at location 6000 H
7013 CF RST 1 Terminate the program.
FLOWCHART:

RESULT:

Input: Output:

7000 : 05 6000:78

(Hexadecimal of 120 which is factorial of a given number)

CONCLUSION: Thus the factorial of given number is store at the memory location 6000 H .
EXPERIMENT NO .6

TITLE: ARRANGING N NUMBERS IN ASCENDING AND DESCENDING ORDER.

AIM: To write an assembly language program to generate ascending and descending


order of N numbers.
APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE: a) Arranging number in ascending order


i) Load register C with 0A H
ii) Load register B with 0AH
iii) Load the number in HL pair.
iv) Move the content of M register to A
v) Increment in HL pair
vi) Compare Memory with accumulator
vii) Repeat the step 3 until carry is generated.
viii) Move the content of M reg to D reg.
ix) Move content of A reg to M reg.
x) Decrement in HL pair.
xi) Move the content of D reg to M reg.
xii) Increment in HL pair
xiii) Decrement reg B.
xiv) Repeat step 4 until zero is not generated
xv) Decrement C register.
xvi) Repeat step 2 until zero is not generated
xvii) Terminate the program.
PROGRAM:

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 0E 0A MVI C 0A H Load the C register with 0A
7002 06 0A BACK MVI B 0A H Load the B with 0A
7004 21 01 60 LXI H 6001 H Load the No. in HL pair
7007 7E AGAIN MOV A, M Move content of M reg to A register
7008 23 INX H Increment in HL
7009 BE CMP M Compare content of Memory and Accumulator
700A DA 12 70 JC SKIP Jump to skip when carry is generated
700D 56 MOV D,M D M
700E 77 MOV M,A M A
700F 2B DCX H Decrement HL pair
7010 72 MOV M,D M D
7011 23 INX H Increment in HL pair
7012 05 SKIP DCR B Decrement in B
7013 C2 07 70 JNZ AGAIN Jump if not zero to 7007 location
7016 0D DCR C Decrement in C
7017 C2 02 70 JNZ BACK Jump if not zero to 7002
701A CF RST 1 Terminate the program.

FLOWCHART: Start
X

Initialize the counter c= 10 C=C-1

Initialize the Counter B=10

NO
Initializes HL Pair Is C= 0

Get the number

Stop
Increment HL pair

Compare two No.

NO If Carry
generated

Interchange the number

B=B-1

Is B=0
RESULT:

Before Execution After Execution

6001 30 H 6001 0A H
6002 25 H 6002 20 H
6003 20 H 6003 23 H
6004 23 H 6004 25 H
6005 27 H 6005 25 H
6006 70 H 6006 27 H
6007 98 H 6007 30 H
6008 0A H 6008 70 H
6009 25 H 6009 75 H

600A 75 H 600A 98 H

CONCLUSION: The numbers are executed in ascending order as shown in table.


PROCEDURE: b) Arranging number in descending order

i) Load register C with 0A H


ii) Load register B with 0AH
iii) Load the number in HL pair.
iv) Move the content of M register to A
v) Increment in HL pair
vi) Compare Memory with accumulator
vii) Repeat the step 13 until carry is not generated.
viii) Move the content of M reg to D reg.
ix) Move content of A reg to M reg.
x) Increment in HL pair.
xi) Decrement reg B.
xii) Repeat step 4 until zero is not generated
xiii) Decrement C register.
xiv) Repeat step 2 until zero is not generated
xv) Terminate the program.

PROGRAM:

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 0E 0A MVI C 0A H Load the C register with 0A

7002 06 0A BACK MVI B 0A H Load the B with 0A

7004 21 01 60 LXI H 6001 H Load the No. in HL pair

7007 7E AGAIN MOV A, M Move content of M reg to A register

7008 23 INX H Increment in HL

7009 BE CMP M Compare content of Memory and Accumulator

700A DA 12 70 JNC SKIP Jump to skip when carry is not generated

700D 56 MOV D,M D M

700E 77 MOV M,A M A

700F 2B DCX H Decrement HL pair


7010 72 MOV M,D M D

7011 23 INX H Increment in HL pair

7012 05 SKIP DCR B Decrement in B

7013 C2 07 70 JNZ AGAIN Jump if not zero to 7007 location

7016 0D DCR C Decrement in C

7017 C2 02 70 JNZ BACK Jump if not zero to 7002

701A CF RST 1 Terminate the program.


FLOWCHART:
Start

Initialize the Counter 1 C = 10

Initialize the Counter 2 B= 10

Initialize HL pair

Get the number

Increment the HL

Compare two Number

Is A<M

Interchange the number

B=B-1

Is B=0

C=C-1

Is C=0 ?

Stop
RESULT:

Before Execution After Execution

6001 30 H 6001 98 H
6002 25 H 6002 75 H
6003 20 H 6003 70 H
6004 23 H 6004 30 H
6005 27 H 6005 27 H
6006 70 H 6006 25 H
6007 98 H 6007 25 H
6008 0A H 6008 23 H
6009 25 H 6009 20 H
600A 75 H 600A 0A H

CONCLUSION: The result of descending order is stored at location 6001 H.


EXPERIMENT NO.7

TITLE: SMALLEST & LARGEST NUMBER IN BLOCK OF DATA

AIM: To write an assembly language program to find smallest & largest number in
block if data.
APPARATUS: 8085 Kit, Power supply, power cord and Opcode sheet.

PROCEDURE: a) Smallest number in block of data

i) The Program finds the smallest no in an array.

ii) Initially, the counter initialized with the size of an array.

iii) Then, two numbers are moved to registers A and B and compared.

iv) After comparison, the smallest no of two must be in the accumulator.


If it is already in the accumulator, then its fine, otherwise it is moved to
the accumulator.

v) Counter is decremented and checked whether it has reached zero. If it


has, loop terminates, otherwise, the next number moved to register and
compared

vi) Let’s assume that the memory location 3000H stores the counter .the
next memory location stores the array.

vii) Initially, H-L pair is loaded with the address of the counter and is
moved to register C.

viii) Then, H-L pair is incremented to point to the first number in the
array.

ix) The first number is moved from memory to accumulator and counter is
decremented by one.

x) H-L pair is again incremented and the second number is moved to


register B.

xi) The two numbers are compared.

xii) After comparison, if A > B, then CF = 0, and if A < B, then CF = 1.


xiii) Carry flag is checked for carry. If there is a carry, it means B is
smaller than A and it is moved to the accumulator.

xiv) The counter is decremented and checked whether it has become zero.

xv) If it hasn't become zero, it means there are numbers left in the array In
thisCase, the control jumps back to increment the H-L pair and moves the
next number to register B.

xvi) This process continues until counter becomes zero, i.e. all the
numbers in the array are compared.

xvii) At last, H-L pair is incremented and the smallest number is


moved from Accumulator to memory.

PROGRAM:-

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 21 LXI6000H Load HL pair with address 6000H

7001 00

7002 60

7003 4E MOV C,M Move content of M reg to A register

7004 23 INXH Increment in HL Pair

7005 7E MOV A,M Move 1st number from memory to reg. A

7006 0D DCR C Decrement Counter

7007 23 INXH Increment in HL Pair

7008 46 MOV B,M Move next number from memory to reg. B

7009 B8 CMP B Compare B with A

700A DA JC 700EH Jump to address 700E if there is no carry


700B 0E

700C 70

700D 78 MOV A,B Move smallest from reg. B to reg. A

700E 0D DCR C Decrement in C

700F C2 JNZ 7007H Jump to address 7007H if counter is not zero

7010 07

7011 70

7012 23 INXH Increment in HL Pair

7013 77 MOV M,A Move the result from reg. A to memory

7014 76 HLT End


FLOWCHART:
RESULT:

Before Execution:

6000H: 05H

6001H: 15H

6002H: 01H

6003H: 65H

6004H: E2H

6005H: 83H

After Execution:

6006: 01H
PROCEDURE: b) Largest number in block of data

i) The Program finds the largest no in an array.


ii) Initially, the counter initialized with the size of an array.
iii) Then, two numbers are moved to registers A and B and compared.
iv) After comparison, the largest no of two must be in the accumulator. If
it is already in the accumulator, then its fine, otherwise it is moved to
the accumulator.
v) Counter is decremented and checked whether it has reached zero. If it
has, loop terminates , otherwise, the next number moved to register
and compared
vi) Let’s assume that the memory location 3000H stores the counter. The
next memory location stores the array.
vii) Initially, H-L pair is loaded with the address of the counter and is
moved to register C.
viii) Then, H-L pair is incremented to point to the first number in the
array.
ix) The first number is moved from memory to accumulator and counter
is decremented by one.
x) H-L pair is again incremented and the second number is moved to
register B.
xi) The two numbers are compared.
xii) After comparison, if A > B, then CF = 0, and if A < B, then CF = 1.
xiii) Carry flag is checked for carry. If there is a carry, it means B is
greater than A and it is moved to the accumulator.
xiv) The counter is decremented and checked whether it has become zero.
xv) If it hasn't become zero, it means there are numbers left in the array.In
this Case, the control jumps back to increment the H-L pair and
moves the next number to register B.
xvi) This process continues until counter becomes zero, i.e. all the
numbers in the array are compared.
xvii) At last, H-L pair is incremented and the largest number is
moved from Accumulator to memory.
PROGRAM:-

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
7000 21 LXI6000H Load HL pair with address 6000H

7001 00

7002 60

7003 4E MOV C,M Move content of M reg to A register

7004 23 INXH Increment in HL Pair

7005 7E MOV A,M Move 1st number from memory to reg. A

7006 0D DCR C Decrement Counter

7007 23 INXH Increment in HL Pair

7008 46 MOV B,M Move next number from memory to reg. B

7009 B8 CMP B Compare B with A

700A D2 JNC 700EH Jump to address 700E if there is no carry

700B 0E

700C 70

700D 78 MOV A,B Move smallest from reg. B to reg. A

700E 0D DCR C Decrement in C

700F C2 JNZ 7007H Jump to address 7007H if counter is not zero

7010 07
7011 70

7012 23 INXH Increment in HL Pair

7013 77 MOV M,A Move the result from reg. A to memory

7014 76 HLT End


FLOWCHART:
RESULT:

Before Execution:

6000H: 05H

6001H: 15H

6002H: 01H

6003H: 65H

6004H: E2H

6005H: 83H

After Execution:

6006: E2H

CONCLUSION:

Thus we have performed program for finding Smallest & Largest number.
EXPERIMENT NO: - 08
TITLE: IMPLEMENTATION OF 7-SEGMENT DISPLAY USING 8255

AIM: Interface 7 segment Display to 8085 using 8255 & display 0 to 9 number on it.
APPARATUS: 8085 Kit, Power supply, 7 segment Display Peripheral kit pin FRC cable.

PROCEDURE:
i) Connect the peripheral with 26 pin FRC cable with 8255
ii) Connect power supply to kit
iii) Write the Program in kit (Hex code) in 8085kit.
iv) Execute the program & observe the output.

THEORY: Before we program for 7 segment display we must have the knowledge
about interfacing. The 7 segment display is connected to port A of 8255 for the
input sequence & Port C for selecting the display. As the 7 segment peripheral kit
contain 8-7segment LEDS so only one we have to choose & display the number on
it.
As shown in fig the 8255 is interfaced in I/O scheme. And port A is connected to
the 7 segment display, so we have to configure port A as output & we have selected
in mode 0. So the control word register format will be as follow.

D7 D6 D5 D4 D3 D2 D1 D0

1 0 0 0 0 0 1 0

Fig. Control word register for 8255

As we are only using port A as output & Port C as Output for selecting one of the 7 segment
display out of 8- 7 segment display. And port B is not interfaced with 7 segment display & port
B can be configured as input port.
Fig: - 7 Segment LED Display

Table:-

No. h g f e d c b a Hex Memory


No Location
0 1 1 0 0 0 0 0 0 C0 7000H
1 1 1 1 1 1 0 0 1 F9 7001H
2 1 0 1 0 0 1 0 0 A4 7002H
3 1 0 1 0 0 0 0 0 B0 7003H
4 1 0 0 1 1 0 0 1 99 7004H
5 1 0 0 0 0 0 1 0 92 7005H
6 1 0 0 0 0 0 1 0 82 7006H
7 1 1 1 1 1 0 0 0 F8 7007H
8 1 0 0 0 0 0 0 0 80 7008H
9 1 0 0 1 1 0 0 0 98 7009H

Address Map for 8255 Interfacing:

A15/A7 A14/A6 A13/A5 A12/A4 A11/A3 A10/A2 A9/A1 A9/A0 Address of


Ports & CWR
0 0 0 0 1 0 0 0 08H
0 0 0 0 1 0 0 1 09H
0 0 0 0 1 0 1 0 0AH
0 0 0 0 1 0 1 1 0BH
FLOWCHART:
Diagram of 7 segment Display:
PROGRAM:

ADDRESS OPCODE LABEL INSTRUCTION COMMENTS


(H) (H)
6000 31 F0 27 LXI SP27FOH Locate stack pointer

6003 3E 82 MVI A 82H Initialize 8255 with CWR=82H

6005 D3 0B OUT 0B

6007 0E 0A REPEAT MVI C, 0A Load count to reg C

6009 21 00 70 LXI H 7000H Initialize HL pointer

600C 3E FF MVI A FF H Clear all 7 segment display

600E D3 08 OUT 08

6010 3E FF MVI A FE H Select 1st no 7 segment display through port c

6012 D3 08 OUT A

6014 11 FF AB LXI D AB FF H Fill delay counter using DE reg.

6017 7E AGAIN MOV A,M Load the no to port 4

6018 D3 08 OUT 08 Then to 7segment display

601A CD1506 CALL DELAY Delay subroutine at 6015 H location

601D 23 INX H Increment memory Pointer

601E 0D DCR C Decrement Count

601F C2 17 60 JNZ AGAIN Check count = 0 if not do again for next no


display
6022 C3 07 60 JMP REPEAT All no. are displayed then repeat it again &
again

6025 CF RST 1 Stop

RESULT:

The 7 segment display shown number from 0 to 9 again & again.

CONCLUSION:
Hence we have run program successfully for displaying 0 to 9 numbers on
single 7 segment display out of 8-7segemnt display. And studied the interfacing
of 8085 with 7 segment display using 8255.
JSPM’S GROUP OF INSTITUTE, PUNE
BHAGWANT INSTITUTE OF TECHNOLOGY
BARSHI

LAB MANNUAL
MICRO PROCESSOR

DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION


ENGINEERING
LIST OF EXPERIMENTS

SR. NO. NAME OF EXPERIMENTS

01 A) ADDITION OF TWO 16 BIT NOS.

B) SUBTRACTION OF TWO 16 BIT NOS.

02 A) ADDITION OF TWO 32 BIT NOS.

B) SUBTRACTION OF TWO 32 BIT NOS.

03 MULTIPLICATION OF 8 BIT NUMBER BY SUCCESSIVE ADDITION

AND LEFT SHIFT AND ADD METHOD

04 DIVISION OF 16 BIT NUMBER BY 8 BIT NUMBER

05 FIND THE FACTORIAL OF A GIVEN NUMBER

06 ARRANGING N NUMBERS IN ASCENDING AND DESCENDING

ORDER

07 SMALLEST & LARGEST NUMBER IN BLOCK OF DATA

08 IMPLEMENTATION OF 7-SEGMENT DISPLAY USING 8255


JSPM Group of Institutes, Pune

BHAGWANT INSTITUTE OF TECHNOLOGY, BARSHI


Electronics & Telecommunication Engineering Department

PRACTICAL CHECK LIST

Sr. Name Of Experiment Date Perform Not Remark


No. perform

01 A) ADDITION OF TWO 16 BIT NOS.


B) SUBTRACTION OF TWO 16 BIT NOS.
02 A) ADDITION OF TWO 32 BIT NOS.
B) SUBTRACTION OF TWO 32 BIT NOS.
03 MULTIPLICATION OF 8 BIT NUMBER BY
SUCCESSIVE ADDITION AND LEFT SHIFT
AND ADD METHOD
04 DIVISION OF 16 BIT NUMBER BY 8 BIT
NUMBER
05 FIND THE FACTORIAL OF A GIVEN
NUMBER
06 ARRANGING N NUMBERS IN ASCENDING
AND DESCENDING ORDER
07 SMALLEST & LARGEST NUMBER IN
BLOCK OF DATA
08 IMPLEMENTATION OF 7-SEGMENT
DISPLAY USING 8255

HOD PRINCIPAL

También podría gustarte