AIM
TO PERFORM THE SUBSTRACTION OF TWO 8 BIT NUMBERS USING 8085ALGORITHM
1. START THE PROGRAM BY LOADING THE FIRST DATA INTO ACCUMULATOR2. MOVE THE DATA TO A REGISTER (B REGISTER)
3. GET THE SECOND DATA AND LOAD INTO ACCUMULATOR
4. SUBTRACT THE TWO REGISTER CONTENTS
5. CHECK FOR CARRY
6. IF CARRY IS PRESENT TAKE 2'S COMPLEMENT OF ACCUMULATOR
7. STORE THE VALUE OF BORROW IN MEMORY LOCATION
8. STORE THE DIFFERENCE VALUE(PRESENT IN ACCUMULATOR) TO A MEMORY
9. LOCATION AND TERMINATE THE PROGRAM
PROGRAM
MVI C,00H INITIALIZE C TO 00
LDA 4150 LOAD THE VALUE TO ACCUMULATOR
MOV B,A MOVE THE CONTENT OF ACCUMULATOR TO B REGISTER
LDA 4151 LOAD THE VALUE TO ACCUMULATOR
SUB B
JNC LOOP JUMP ON NO CARRY
CMA COMPLEMENT VALUE IN ACCUMULATOR
INR A INCREMENT VALUE IN ACCUMULATOR
INR C INCREMENT VALUE IN REGISTER C
LOOP : STA 4152 STORE THE VALUE OF A -REGISTER TO MEMORY ADDRESS
MOV A,C MOVE CONTENTS OF REGISTER C TO ACCUMULATOR
STA 4153 STORE THE VALUE OF ACCUMULATOR MEMORY ADDRESS
HLT TERMINATE THE PROGRAM
No comments:
Post a Comment