Wednesday 28 September 2011

16-BIT ARITHMETIC OPERATION


16-BIT ARITHMETIC OPERATION
            16-BIT ADDITION
AIM:
            To write an assembly language program for the addition of two 16 – bit numbers using 8085.
APPARATUS REQUIRED:
                                                8085 kit, power chord
ALGORITHM:
1.      Start the program     
2.      Clear the B-register 
3.      Load the data to HL pair register
4.      Exchange the content of HL and DE        
5.      Load the data to HL pair register            
6.      Add the content of HL and De pair 
7.      Jump on no carry to step – 9
8.      Increment the content pf B-register
9.      Store the content of HL pair to the address 5504
10. Store the content of B-register
11. Stop the program

PROGRAM:  
   ADDRESS
LABEL
OPCODE
MNEMONICS
OPERAND
COMMENTS
4500

06,00
MVI
B, 00
Clear b register
4502

2A, 00,55
LHLD
5500
Load data1 to hl register
4505

EB
XCHG

Move the data in de to hl register
4506

2A, 02,55
LHLD
5502
Load the data2 to hl pair
4509

19
DAD
D
Add the content of the hl and de pair
450A

D2, 0E, 45
JNC
LOOP
Jump on no carry to an address
450D

04
INR
B
Increment the b register
450E
LOOP
22,04,55
SHLD
5504
Store the result
4511

78
MOV
A, B
Move carry to b register.
4512




32,06,55
STA
5506
Store the carry.
4515

76
HLT

Stop the process.

INPUT:         5500 – 03      5501 – FF      5502 – 03      5503 – EF      5504 – FE
OUTPUT:     5505 – 06 (Result),             5506 – 01(carry)

RESULT:
Thus the assembly language program for 16-bit addition is executed and the results are verified.

0 comments:

Post a Comment