To perform the subtraction of two 8 bit numbers using 8085.
ALGORITHM:
1. Start the program by loading the first data into Accumulator.
Move the data to a register (B register).
2. Get the second data and load into Accumulator.
3. Subtract the two register contents.
4. Check for carry.
5. If carry is present take 2’s complement of Accumulator.
6. Store the value of borrow in memory location.
7. Store the difference value (present in Accumulator) to a memory
8. location and terminate the program.
PROGRAM:
MVI C, 00I Initialize C to 00
LDA 4150 Load the value to Acc.
MOV B, A Move the content of Acc to B register.
LDA 4151 Load the value to Acc.
SUB B
JNC LOOP Jump on no carry.
CMA Complement Accumulator contents.
INR A Increment value in Accumulator.
INR C Increment value in register C
LOOP: STA 4152 Store the value of A-reg 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.
OBSERVATION:
Input: 06 (4150)
02 (4251)
Output: 04 (4152)
01 (4153)
RESULT:
Thus the program to subtract two 8-bit numbers was executed.
This comment has been removed by the author.
ReplyDelete.
Deletegreat work..!
ReplyDeletehow to find the square of a number ...
ReplyDeletehow to find square root
ReplyDelete// TO FIND SQUARE FROM LOOP-UP TABLE
Delete# BEGIN 0000H
LDA C050
ADI 60
MOV L,A
MVI H,C0
MOV A,M
STA C051
HLT
// First create the look up table->C060=00,C061=01 ,,, C069=81
// EXAMPLE-> C050=09
// Answer-> C051=81
# ORG C060
# DB 00H,01H,04H,09H,16H,25H,36H,49H,64H,81H
# ORG C050
# DB 04H
thank you fella !
ReplyDeletehow to perform the subtraction of three 8 bit numbers using 8085.
ReplyDeletehow to convert a hex number to decimal?
ReplyDeletehow to perform subtraction with carry?
ReplyDeleteHow to generate a Fibonacci series
ReplyDeletePLEASE THANKS HELP ME I HAVE ASSIGNMENT ABOUT AVERAGE OF TWO NUMBERS HOW TO WRITE APROGRAM
ReplyDeleteand any one can help about the quasion that i write above please try to help me
ReplyDeletehow to observe the result from the simulator????
ReplyDeleteIf we talk about printers first name comes in our head is Canon Printers, for latest and updated Drivers for Canon go to the Following Sites.
ReplyDeletewww.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
www.canon.com/ijsetup
If we talk about printers first name comes in our head is Brother Printers, for latest and updated Drivers for Brother go to the Following Sites.
ReplyDeletesolutions.brother.com/windows
solutions.brother.com/windows
solutions.brother.com/windows
solutions.brother.com/windows