A) Software/Simulator Based: (Using Anshuman 8085 Microprocessor Xpo-85 Kit)
A) Software/Simulator Based: (Using Anshuman 8085 Microprocessor Xpo-85 Kit)
A) Software/Simulator based
(using Anshuman 8085 microprocessor xpo-85 kit)
Contents
PROCEDURE:
2. Execution Steps
Esc
G
Enter
Enter
Program starting address
Enter
S
Enter
Press any key 2 times
Enter
Enter
Register Name
AIM: To write an assembly language program to Add two 8-bit numbers using different Addressing
Modes.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 3E, 20 MVI A, 20 H Move Immediate data 10 H in A reg.
7002 06, 10 ADI 10 H Add Immediate data 10 H with A reg. content
7004 CF RST 1 Terminate the program
RESULT:
Input: Output:
A reg. = 20 H A reg. = 30 H
&
Immediate data = 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 3E, 20 MVI A, 30 H Move Immediate data 10 H in A reg.
7002 06, 10 MVI B, 10 H Add Immediate data 10 H with A reg. content
7004 80 ADD B Add contents of A & B reg.
7005 CF RST 1 Terminate the program
RESULT:
Input: Output:
A reg. = 30 H A reg. = 40 H
&
B reg. = 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
Loads Immediate data into HL pair from 7501
7000 21, 01, 75 LXI H, 7501 H
H memory location (1st no.)
7003 7E MOV A, M Copy the content from HL specified memory
location
Increment HL by 1. Points to the next memory
7004 23 INX H
location 7502 H for 2nd no.
7005 86 ADD M Add 1st no. with 2nd no.
Increment HL by 1. Points to the next memory
7006 23 INX M
location 7503 H to store result of addition
7007 77 MOV M, A Move the result of addition to 7503 H
7008 CF RST 1 Terminate the program
RESULT:
Input: Output:
7501 H : 30 H 7503 H : 40 H
&
7502 H : 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
Load A reg. directly the contents of 7500 H
7000 3A, 00, 75 LDA 7500 H
(1st no.)
7003 47 MOV B, A Move 1st no. from A reg. to B reg.
Load A reg. directly the contents of 7500 H
7004 3A, 01, 75 LDA 7501 H
(2nd no.)
7007 80 ADD B Add 1st no. with 2nd no.
7008 32, 02, 75 STA 7502 H Store the result of addition at 7502 H directly
700B CF RST 1 Terminate the program
RESULT:
Input: Output:
7500 H : 30 H 7502 H : 40 H
&
7501 H : 10 H
AIM: To write an assembly language program to Subtract two 8-bit numbers using different
Addressing Modes.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 3E, 20 MVI A, 20 H Move Immediate data 10 H in A reg.
Subtract Immediate data 10 H with A reg.
7002 D6, 10 SUI 10 H
content
7004 CF RST 1 Terminate the program
RESULT:
Input: Output:
A reg. = 20 H A reg. = 10 H
&
Immediate data = 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 3E, 20 MVI A, 30 H Move Immediate data 10 H in A reg.
7002 06, 10 MVI B, 10 H Add Immediate data 10 H with A reg. content
7004 90 SUB B Subtract contents of A & B reg.
7005 CF RST 1 Terminate the program
RESULT:
Input: Output:
A reg. = 30 H A reg. = 20 H
&
B reg. = 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
Loads Immediate data into HL pair from 7501
7000 21, 01, 75 LXI H, 7501 H
H memory location (1st no.)
Copy the content from HL specified memory
7003 7E MOV A, M
location
Increment HL by 1. Points to the next memory
7004 23 INX H
location 7502 H for 2nd no.
RESULT:
Input: Output:
7501 H : 30 H 7503 H : 20 H
&
7502 H : 10 H
Memor
y Opcode Mnemonics & Operands Comments
Address
Load A reg. directly the contents of 7500 H
7000 3A, 00, 75 LDA 7500 H
(1st no.)
7003 47 MOV B, A Move 1st no. from A reg. to B reg.
Load A reg. directly the contents of 7500 H
7004 3A, 01, 75 LDA 7501 H
(2nd no.)
7007 90 SUB B Subtract 1st no. with 2nd no.
7008 32, 02, 75 STA 7502 H Store the result of addition at 7502 H directly
700B CF RST 1 Terminate the program
RESULT:
Input: Output:
7500 H : 30 H 7502 H : 20 H
&
7501 H : 10 H
AIM: To write an assembly language program to add two 16-bit numbers (Numbers are stored at
specified memory location).
Address
Get 1st number in HL pair from memory
7000 2A, 01, 76 LHLD 7601 H location 7601 H
RESULT:
Input: 1 Output: 1
7601 H = LSB of 1st no. (11 H) 7500 H = Carry (00 H)
7602 H = MSB of 1st no. (11 H) 7501 H = LSB of Result (33 H)
7603 H = LSB of 2nd no. (22 H) 7502 H = MSB of Result (33 H)
7604 H = MSB of 2nd no. (22 H)
Input: 2 Output: 2
7601 H = LSB of 1st no. (11 H) 7500 H = Carry (01 H)
7602 H = MSB of 1st no. (91 H) 7501 H = LSB of Result (34 H)
7603 H = LSB of 2nd no. (23 H) 7502 H = MSB of Result (82 H)
7604 H = MSB of 2nd no. (81 H)
AIM: To write an assembly language program to subtract two 16-bit numbers (Numbers are stored at
specified memory location).
Address
Get 1st number in HL pair from memory
7000 2A, 01, 76 LHLD 7601 H location 7601 H
RESULT:
Input: Output:
7601 H = LSB of 1st no. (30 H) 7605 H = LSB of Result (20 H)
7602 H = MSB of 1st no. (40 H) 7606 H = MSB of Result (20 H)
7603 H = LSB of 2nd no. (10 H)
7604 H = MSB of 2nd no. (20 H)
Memor
Mnemonics &
y Opcode Comments
Operands
Address
7000 06, 12 MVI B, 12 H Move immediate data 12 H in B reg. (MSB of
1st no.)
Move immediate data 34 H in C reg. (LSB of 1st
7002 0E, 34 MVI C, 34 H
no.)
Move immediate data 43 H in D reg. (MSB of
7004 16, 43 MVI D, 43 H
2nd no.)
Move immediate data 21 H in E reg. (LSB of 2nd
7006 1E, 21 MVI E, 21 H
no.)
7008 7B MOV A, E Move LSB of 2nd no. to A reg.
7009 81 ADD C Add with LSB of 1st no.
700A 6F MOV L, A Store the LSB result from A reg. in L reg.
700B 7A MOV A, D Move MSB of 2nd no. to A reg.
700C 88 ADC B Add with carry MSB of 1st no.
700D 67 MOV H, A Store the MSB result from A reg. in H reg.
700E CF RST 1 Terminate the program
RESULT:
Input: Output:
1st no. = 1234 H (in BC reg. pair) Result = 5555 H (in HL reg. pair)
2nd no. = 4321 H (in DE reg. pair)
Memor
Mnemonics &
y Opcode Comments
Operands
Address
Move immediate data 12 H in B reg. (MSB of
7000 06, 43 MVI B, 43 H
1st no.)
Move immediate data 34 H in C reg. (LSB of 1st
7002 0E, 21 MVI C, 21 H
no.)
RESULT:
Input: Output:
1st no. = 4321 H (in BC reg. pair) Result = 3113 H (in HL reg. pair)
2nd no. = 1234 H (in DE reg. pair)
AIM: To write an assembly language program to multiply two 8-bit numbers (using Successive
Addition method).
Memor
y Opcode Mnemonics & Operands Comments
Address
Move 1st number (Multiplicand) in C reg.
7000 0E, 25 MVI C, 25 H
Move 2nd number (Multiplier) in E reg.
7002 1E, 05 MVI E, 05 H
7004 06, 00 MVI B, 00H Clear B reg.
RESULT:
Input: Output:
AIM: To write an assembly language program to multiply two 8-bit numbers (using Successive
Addition method).
Memor
Mnemonics &
y Opcode Comments
Operands
Address
Get 1st number i.e.; Multiplicand in HL pair
7000 2A, 01, 75 LHLD 7501 H
RESULT:
Input: Output:
AIM: To write an assembly language program to divide two 8-bit numbers (using Successive
Subtraction method).
Memor
Mnemonics &
y Opcode Comments
Operands
Address
Get 1st number (Divisor) in A reg.
7000 3A, 01, 75 LDA 7501 H
Copy divisor in B reg.
7003 47 MOV B, A
RESULT:
Input: Output:
AIM: To write an assembly language program to divide two 8-bit numbers (using Shift & Subtract
method).
Memor
Mnemonics &
y Opcode Comments
Operands
Address
Get Dividend in HL pair directly from 7501H
7000 2A, 01, 75 LHLD 7501 H memory address
RESULT:
Input: Output:
AIM: To write an assembly language program for block transfer of 10 data bytes (Without
Overlapping).
Memor
y Opcode Mnemonics & Operands Comments
Address
HL is used as memory pointer for 1st block
7000 21, 00, 75 LXI H, 7500 H
whose starting address is 7500 H
DE is used as memory pointer for 2nd block
7003 11, 00, 76 LXI D, 7600 H
whose starting address is 7600 H
7006 0E, 0A MVI C, 0A H C reg. is used as a counter, which tells the
Result:
Before Execution:
Memory Memory
Address Data Address Data
7500 H 00 7600 H 44
7501 H 01 7601 H 77
7502 H 02 7602 H 01
7503 H 03 7603 H 89
7504 H 04 7604 H 14
7505 H 05 7605 H 16
7506 H 06 7606 H 25
7507 H 07 7607 H 47
7508 H 08 7608 H 15
7509 H 09 7609 H 77
After Execution:
Memory Memory
Address Data Address Data
7500 H 00 7600 H 00
7501 H 01 7601 H 01
7502 H 02 7602 H 02
7503 H 03 7603 H 03
7504 H 04 7604 H 04
7505 H 05 7605 H 05
7506 H 06 7606 H 06
7507 H 07 7607 H 07
7508 H 08 7608 H 08
7509 H 09 7609 H 09
AIM: To write an assembly language program for block transfer of 10 data bytes (With Overlapping).
Memor
y Opcode Mnemonics & Operands Comments
Address
HL is used as memory pointer for 1st block
7000 21, 00, 75 LXI H, 7500 H
whose starting address is 7500 H
Result:
Before Execution:
Memory Memory
Address Data Address Data
7500 H 00 7505 H 44
7501 H 01 7506 H 77
7502 H 02 7507 H 01
7503 H 03 7508 H 89
7504 H 04 7509 H 14
7505 H 05 750A H 16
7506 H 06 750B H 25
7507 H 07 750C H 47
7508 H 08 750D H 15
SMSMPITR, AKLUJ Page 18
7509 H 09 750E H 77
8085 Microprocessor Lab Manual
After Execution:
Memory Memory
Address Data Address Data
7500 H 00 7505 H 00
7501 H 01 7506 H 01
7502 H 02 7507 H 02
7503 H 03 7508 H 03
7504 H 04 7509 H 04
7505 H 05 750A H 05
7506 H 06 750B H 06
7507 H 07 750C H 07
7508 H 08 750D H 08
7509 H 09 750E H 09
Memor
y Opcode Mnemonics & Operands Comments
Address
HL is used as memory pointer for 1st block
7000 21, 00, 75 LXI H, 7500 H whose starting address is 7500 H
Result:
Before Execution:
Memory Memory
Address Data Address Data
7500 H 01 7600 H 11
7501 H 02 7601 H 12
7502 H 03 7602 H 13
7503 H 04 7603 H 14
7504 H 05 7604 H 15
7505 H 06 7605 H 16
7506 H 07 7606 H 17
7507 H 08 7607 H 18
7508 H 09 7608 H 19
7509 H 10 7609 H 20
SMSMPITR, AKLUJ Page 20
8085 Microprocessor Lab Manual
After Execution:
Memory Memory
Address Data Address Data
7500 H 11 7600 H 01
7501 H 12 7601 H 02
7502 H 13 7602 H 03
7503 H 14 7603 H 04
7504 H 15 7604 H 05
7505 H 16 7605 H 06
7506 H 17 7606 H 07
7507 H 18 7607 H 08
7508 H 19 7608 H 09
7509 H 20 7609 H 10
Memor
y Opcode Mnemonics & Operands Comments
Address
B reg. is used as a counter, which tells the
7000 06, 0A MVI B, 0A H number of data bytes to be transferred
7002 21, 09, 76 LXI H, 7609 H HL is used as memory pointer for 1st block
Result:
Memory Memory
Address Data Address Data
7600 H 01 7650 H 10
7601 H 02 7651 H 09
7602 H 03 7652 H 08
7603 H 04 7653 H 07
7604 H 05 7654 H 06
7605 H 06 7655 H 05
7606 H 07 7656 H 04
7607 H AKLUJ
SMSMPITR, 08 Page 22 7657 H 03
7608 H 09 7658 H 02
7609 H 10 7659 H 01
8085 Microprocessor Lab Manual
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Set pointer for block/array
7003 46 MOV B, M Load the Count
Increment the memory pointer (points to next
7004 23 INX H
memory location for next number)
7005 7E MOV A, M Set 1st element as largest data
RESULT:
Input: Output:
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Set pointer for block/array
7003 46 MOV B, M Load the Count
Increment the memory pointer (points to next
7004 23 INX H
memory location for next number)
7005 7E MOV A, M Set 1st element as largest data
7006 05 DCR B Decrement the Count
loop: Increment the memory pointer (points to next
7007 23 memory location for next number)
INX H
7008 BE CMP M If A reg. > M go to ahead. If not the go to next
7009 D2, 0D, 70 JNC ahead (700D H) step
RESULT:
Input: Output:
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Set pointer for block/array
7003 4E MOV C, M Load the Count at 7500 H into C reg.
7004 0D DCR C Decrement the Count
repeat: Copy it in D reg. (for bubble sort (N - 1) times
7005 51
MOV D, C required)
7006 21, 01, 75 LXI H, 7501 H Get the 1st value from 7501 H into H reg.
loop:
7009 7E Get the 1st value in A reg.
MOV A, M
Increment the memory pointer (points to next
700A 23 INX H
memory location for next number)
700B BE CMP M Compare it with the value at next location. If
A < M go to skip. If they are out order go to
700C DA, 14, 70 JC skip (7014 H)
next step
700F 46 MOV B, M
Exchange the contents of A reg. and M
7010 77 MOV M, A
RESULT:
Input: Output:
05 H (7500 H) ---- Block/Array Size 05 H (7500 H) ---- Block/Array Size
05 H (7501 H) ---- 1st no. 01 H (7501 H) ---- 1st no.
04 H (7502 H) ---- 2nd no. 02 H (7502 H) ---- 1st no.
03 H (7503 H) ---- 3rd no. 03 H (7503 H) ---- 1st no.
02 H (7504 H) ---- 4th no. 04 H (7504 H) ---- 1st no.
01 H (7505 H) ---- 5th no. 05 H (7505 H) ---- 1st no.
ARRANGE THE ELEMENTS OF A BLOCK OF DATA IN DESCENDING
ORDER
AIM: To write an assembly language program to arrange a block/array or data in descending order.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Set pointer for block/array
7003 4E MOV C, M Load the Count at 7500 H into C reg.
7004 0D DCR C Decrement the Count
Copy it in D reg. (for bubble sort (N - 1) times
7005 51 repeat: MOV D, C
required)
7006 21, 01, 75 LXI H, 7501 H Get the 1st value from 7501 H into H reg.
7009 7E loop: MOV A, M Get the 1st value in A reg.
Increment the memory pointer (points to next
700A 23 INX H
memory location for next number)
700B BE CMP M Compare it with the value at next location. If
A > M go to skip. If they are out order go to
700C D2, 14, 70 JNC skip (7014 H)
next step
700F 46 MOV B, M
Exchange the contents of A reg. and M
7010 77 MOV M, A
7011 2B DCX H Decrement D reg. content by 1
7012 70 MOV M, B Move back the content of M from B reg.
Increment the memory pointer (points to next
7013 23 INX H
memory location for next number)
7014 15 skip: DCR D
Repeat comparisons till D = 0
7015 C2, 09, 70 JNZ loop (7009 H)
7018 0D DCR C Repeat comparisons till C = 0
RESULT:
Input: Output:
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Set pointer for block/array
Get MSD (Most Significant Digit) in A reg.
7003 7E MOV A, M
from M
7004 87 ADD A MSD X 2
7005 47 MOV B, A Store MSD X 2 in B reg.
7006 87 ADD A MSD X 4
7007 87 ADD A MSD X 8
7008 80 ADD B MSD X 10
7009 23 INX H Point to LSD (Least Significant Digit)
700A 86 ADD M Add to form HEX
700B 23 INX H Increment HL by 1
700C 77 MOV M, A Store the result at incremented location
700D CF RST 1 Terminate the program
RESULT:
Input: Output:
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Initialize memory pointer
7003 16, 00 MVI D, 00 H Clear D reg. for MSB
7005 AF XRA A Clear A reg.
7006 4E MOV C, M Get HEX data
7007 C6, 01 loop2: ADI 01 H Count the number one by one
7009 27 DAA Adjust for BCD count
700A D2, 0E, 70 JNC loop1 (700E H)
700D 14 INR D Perform repeated addition for C number of
700E 0D loop1: DCR C times
700F C2, 07, 70 JNZ loop2 (7007 H)
7012 32, 01, 75 STA 7501 H Store the LSB
7015 7A MOV A, D
7016 32, 02, 75 STA 7502 H Store the MSB
7019 CF RST 1 Terminate the program
RESULT:
Input: Output:
9. FIBONACCI SERIES
AIM: To write an assembly language program to generate the Fibonacci series with given first two
terms.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 73 LXI H, 7300 H Load the HL register pair immediately
7003 46 MOV B, M Move the memory content in to B register
7004 23 INX H Increment the HL register pair
7005 4E MOV C, M Move the memory content in to C register
7006 05 DCR B Decrement the B register content
7007 23 INX H Increment the HL register pair
7008 7E MOV A, M Move the memory content in to accumulator
7009 05 DCR B Decrement the B register content
Up:
700A 57 Move the accumulator content to D register
MOV D, A
700B 81 ADD C Add the C register content with accumulator
700C 23 INX H Increment the HL register pair
700D 77 MOV M, A Move the accumulator content to memory
700E 4A MOV C, D Move the D register content to C register
700F 05 DCR B Decrement the B register content
7010 C2, 0A,C1 JNZ (Up) 700A H Jump if no zero to 700A H
7013 CF RST 1 Halt the execution
RESULT:
Memory Data
Address
Aim: To find square of the number from 0 to 9 using Look up table (Table of Square)
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 76 LXI H, 7600 H Initialize Look up table address
3A, 00,
7003 LDA 7500 H Get the data
75
7006 FE, 0A CPI 0A H Check input > 9
DA,
7008 JC after (7011 H) If yes Error
11,70
700B 3E, FF MVI A, FF H Error Indication
700D 32, 01, 75 STA 7501 H Store the result at 7501 H memory address
7010 CF RST 1 Terminate the program
7011 4F after: MOV C, A Add the desired Address
7012 06, 00 MVI B, 00 H
7014 09 DAD B Get HL+BC & store result in HL
7015 7E MOV A, M
7016 32, 01, 75 STA 7501 H Store the result at 7501 H memory address
7019 CF RST 1 Terminate the program
LOOKUP TABLE:
Memory Square
Address
7600 00
7600 01
7601 04
7602 09
7603 16
7604 25
7605 36
7606 49
7607 64
7608 81
RESULT:
Input: 7500 H: 05 H
Output: 7501 H: 25 H (Square)
Input: 7500 H: 11 H
Output: 7501 H: FF H (Error Indication)
11.SQUARE OF A GIVEN NUMBER USING LOOK UP TABLE
Aim: To find factorial of the given number.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 21, 00, 75 LXI H, 7500 H Load the no. in the Accumulator specified by
the memory location 7500 H.
7003 7E MOV A, M
Compare the no. with 01 H.
7004 FE, 01 CPI 01 H
If not equal go to L1.
7006 C2,0B,70 JNZ L1 (700B)
If no. = 01 H, then load A with 01 H that is the
7009 3E MVI A, 01 H
final answer.
Stop the program.
700A CF RST1
L1:
700B 56 Get the no. in D reg.
MOV D, M
Store the no. at B reg.
700C 46 MOV B, M
BACK:
700D 48 Get the no. in C reg.
MOV C, B
700E 0D DCR C Decrement the no. by 01 H.
700F 0D DCR C Decrement the no. by 01 H.
C2, If not equal to zero then go to BACK.
7010 JNZ BACK (700D)
0D,70
7013 CF RST 1 Terminate the program if equal to zero.
BACK1:
7014 82 Add the no. with D reg. contents.
ADD D
7015 0D DCR C Decrement the no. by o1 H again.
7016 C2, 14,70 JNZ BACK1 (7014) If not equal to zero then go to BACK1.
7019 05 DCR B If equal then decrement B reg. contents.
701A 57 MOV D, A Get addition value in D reg.
C2,
701B JNZ BACK (700D) If not equal to zero then go to BACK.
0D,70
701E CF RST1 If equal, then terminate the program.
RESULT:
B) Hardware Based
(Interfacing with 8085 P)
Contents
6. Interfacing display 43
AIM: To write an assembly language program to input data bytes from peripheral port & to store
them in memory.
APPARATUS: XPO-85 Microprocessor kit, Scanning Technique kit, 5V power supply, Keyboard.
CONNECTIONS: Connect XPO-85 kit with Scanning Technique kit using RS-232 cable. Connect
one end of cable at lower 8255 chip of XPO-85 kit & another end of cable to the Scanning Technique
kit.
Address
7000 3E, 92 MVI A, 92 H Initialize Port A & Port B as input port in
7002 D3, 0B OUT CWR (0B H) Mode 0 & Port C as output port in Mode 0
Get 00 H in A reg. (As data read from input
device [ here input device is from 4 X 4
7004 3E, 00 MVI A, 00 H
Matrix Keyboard] so to know the data from it
A reg. is initialized with 00 H)
IN PORT B (09 Read a key from 4 X 4 Matrix Keyboard
7006 DB, 09
H) present in Scanning Technique kit.
Store A reg. content i.e., data read from input
7008 32, 00, 75 STA 7500 H
device at 7500 H memory location
700B CF RST 1 Terminate the program
RESULT:
Input:
Press any key from 4 X 4 Matrix Keyboard present in Scanning Technique kit.
Output:
Aim: To write an assembly language program to output data bytes from memory to peripheral
port.
APPARATUS: XPO-85 Microprocessor kit, Scanning Technique kit, 5V power supply, Keyboard.
CONNECTIONS: Connect XPO-85 kit with Scanning Technique kit using RS-232 cable. Connect
one end of cable at lower 8255 chip of XPO-85 kit & another end of cable to the Scanning Technique
kit.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 3E, 92 MVI A, 82 H Initialize Port B as input port in Mode 0 &
7002 D3, 0B OUT CWR (0B H) Port A and Port C as output port in Mode 0
Initialize HL as memory pointer & it points
7004 21, 00, 76 LXI H, 7600 H
to 7600 H memory location
7006 7E MOV A, M Data is read from 7600 H memory location &
this data is given or outputted to the output
7008 D3, OA OUT PORT C (0A H) device (here output device is 8 X 8 LED
matrix display)
700B CF RST 1 Terminate the program
RESULT:
Input: Output:
Conclusion:
Apparatus: XPO-85 Microprocessor kit, Scanning Technique kit, 5V power supply, Keyboard.
Connections: Connect XPO-85 kit with Scanning Technique kit using RS-232 cable. Connect one
end of cable at lower 8255 chip of XPO-85 kit & another end of cable to the Scanning Technique kit.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 31, F0, 27 LXI SP, 27F0 H Initialize for Stack Pointer
7003 21, 2F, 70 LXI H, DSPLY (702F H) Pointer for Display
7006 3E, 82 MVI A, 82 H
Port A & Port C o/p & Port B as i/p
7008 D3, 0B OUT CWR
START:
700A 06, 08
MVI B, 08 H Count for Display
700C 0E, FE MVI C, 0FE H
NEXTDSP:
700E 3E, FF
MVI A, 0FF H Blank All Display
7010 D3, 08 OUT PORT A
7012 7E MOV A, M
Display Data
7013 D3, 08 OUT PORT A
7015 23 INX H Data for Next Display
7016 79 MOV A, C
Select Seven Segment Display
7017 D3, 0A OUT PORT C
7019 37 STC Set Carry = 1
701A 17 RAL
Select Next Segment
701B 4F MOV C, A
701C 11, 55, 00 LXI D, 0055 H
Initialize DE pair for Delay Subroutine
701F CD, 15, 06 CALL DELAY
7022 CD, 72, 20 CALL TEST
7025 D2, 0C, 00 JNC CMDMOD
7028 05 DCR B All Segments are Displayed?
JNZ NEXTDSP (700E
7029 C2, 0E, 70 No, Go for Next Display
H)
702C C3, 0A, 70 JMP START (700A H) Yes, Display Again
DSPLY: Code For ‘A’ (LEDs are Active LOW
702F 88
DFB 88 H device)
7030 C8 DFB 0C8 H Code For ‘N’
7031 92 DFB 92 H Code For ‘S’
7032 89 DFB 89 H Code For ‘H’
7033 C1 DFB 0C1 H Code For ‘U’
7034 AA DFB 0AA H Code For ‘M’
7035 88 DFB 88 H Code For ‘A’
7036 C8 DFB 0C8 H Code For ‘N’
END
RESULT:
On execution of the program “ANSHUMAN” will be displayed on 7-Segment LED Display (This 7-
Segment LED Display comprises of 8 number of single 7-Segment Display).
Conclusion:
Hence 7-Segment LED Matrix Display is interfaced with 8085 and “ANSHUMAN” is displayed on it.
Connections: Connect XPO-85 kit with AD/DA – II kit using RS-232 cable. Connect one end of
cable at lower 8255 chip of XPO-85 kit & another end of cable to the AD/DA – II kit. Connect 12V
power supply to AD/DA – II kit.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 31, 00, 21 LXI SP, 2100 H Initialize Stack Pointer
7003 CD, 8A, 04 CALL CRLF
7006 3E, 81 MVI A, 81 H Initialize Port A, Port B & Port CUPPER as
7008 D3, 0B OUT CWR O/P & Port CLOWER as I/P
700A 3E, 01 MVI A, 01 H
Select Channel 1
700C D3, 09 OUT PORT B
700E 3E, 09 MVI A, 09 H
Set PC4 (ALE) high
7010 D3, 0B OUT CWR
7012 3E, 08 MVI A, 08 H
Reset PC4 (Latched) pulse for ALE pin
7014 D3, OB OUT CWR
7016 3E, 83 MVI A, 83 H
Set Port B as I/P keeping rest same
7018 D3, 0B OUT CWR
START:
701A 3E, 0D
MVI A, 0D H Set PC6 (Start of Conversion, SOC)
701C D3, 0B OUT CWR
701E 3E, 0C MVI A, 0C H Reset PC6
RESULT:
On execution of the program, as we vary the voltage nob present on AD/DA – II kit which varies
from 0 to 5V, resptly Digital equivalent of voltages appear on the LCD display of XPO-8085 kit.
Conclusion:
Connections: Connect XPO-85 kit with AD/DA – II kit using RS-232 cable. Connect one end of
cable at lower 8255 chip of XPO-85 kit & another end of cable to the AD/DA – II kit. Connect 12V
power supply to AD/DA – II kit.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 31, 00, 21 LXI SP, 2100 H Initialize Stack Pointer
7003 3E, 80 MVI A, 80 H
Initialize Port A, Port B and Port C as O/P
7005 D3, 0B OUT CWR
7007 16, 00 MVI D, 00 H
Count for Delay
7009 1E, FF MVI E, 0FF H
UP:
700B 3E, FF 0FF H is the pulse max. height (max.
MVI A, 0FF H
amplitude value) give to DAC
700D D3, 08 OUT PORT A
700F CD, 15, 06 CALL DELAY
Delay which specifies width of pulse
7012 CD, 15, 06 CALL DELAY
7015 3E, 00 MVI A, 00 H 00 H is the pulse max. height (max.
amplitude value) give to DAC
7017 D3, 08 OUT PORT A
7019 CD, 15, 06 CALL DELAY
Delay which specifies width of pulse
701C CD, 15, 06 CALL DELAY
701F C3, 73, 7A JMP UP (700B H) Give continuous waveform
7022 CF RST 1 Terminate the program
RESULT:
On execution of the program a Square wave is observed on CRO at TP J11 w.r.t GND point.
Conclusion:
Memor
y Opcode Mnemonics & Operands Comments
Address
START:
7000 3E, B6
MVI A, 0B6 H Initialize the 8253 Counter 2 mode
7002 D3, 1B OUT CWR
7004 3E, 00 MVI A, 00 H Load LSB count of timer for 1KHz
7006 D3, 1A OUT PORT C Freq.
7008 3E, 01 MVI A, 01 H Load MSB count of timer for 1KHz
700A D3, 1A OUT CWR Freq.
700C 11, FF, FF LXI D, 0FFFF H Count value for delay
700F CD, 15, 06 CALL DELAY Delay routine
JMP START (7000
7012 C3, 00, 70 Execute all again
H)
RESULT:
On execution of the program a Square wave of 10 KHz is generated and this wave is observed using
CRO at pin 17 of 8253 or L24 on motherboard (XPO-85 kit) w.r.t. GND, a Square wave of 10KHz
can be measured.
Conclusion:
6. Interfacing display
Aim: To write an assembly language program to interface display for displaying alphabet ‘A’
on 8 X 8 LED matrix.
Apparatus: XPO-85 Microprocessor kit, Scanning Technique kit, 5V power supply, Keyboard.
Connections: Connect XPO-85 kit with Scanning Technique kit using RS-232 cable. Connect one
end of cable at lower 8255 chip of XPO-85 kit & another end of cable to the Scanning Technique kit.
Memor
y Opcode Mnemonics & Operands Comments
Address
7000 31, 0F, 27 LXI SP, 27F0 H Initialize for Stack Pointer
7003 21, 2F, 70 LXI H, LDSPLY Pointer for LED Display
7006 3E, 82 MVI A, 82 H
Port A & Port C as O/P & Port B as I/P
7008 D3, 0B OUT CWR
START:
700A 06, 08 Count for LED Display
MVI B, 08 H
700C 0E, 7F MVI C, 7F H
NXTLEDC:
700E 3E, FF
MVI A, 0FF H Blank All LEDs
7010 D3, 08 OUT PORT A
7012 7E MOV A, M
Display Data
7013 D3, 0A OUT PORT C
7015 23 INX H Data for Next LED Column
7016 79 MOV A, C
Select LED Column for Display
7017 D3, 08 OUT PORT A
7019 37 STC Set Carry = 1
701A 1F RAR Select Next Segment
701B 4F MOV C, A
701C 11, 55, 00 LXI D, 5500 H Initialize DE pair for Delay
701F CD, 15, 06 CALL DELAY Delay Subroutine
7022 CD, 72, 20 CALL TEST
7025 D2, 0C, 00 JNC CMDMOD
7028 05 DCR B
All the LEDs are Displayed?
7029 C2, 0E, 70 JNZ NXTLEDC No, Go for Next Display
Result:
On execution of the program alphabet “A” is displayed on 8 X 8 LED Matrix (LEDs are active low
device).
LED C0 B7 77 77 77 77 B7 77
1 2 3 4 5 6 7 8
Conclusion: