Posts

Showing posts with the label SUM OF SERIES

SUM OF SERIES

Image
CALCULATE THE SUM OF SERIES OF NUMBERS WITH CARRY  THEORY :  In 8085 microprocessor, In this program, we perform addition for 'n' numbers. Where we define the total no's to be added. All the values will be added with the accumulator. And this problem we have a new carry flag to enable the carry where we can see 16-bit resultant value. fig: Binary Addition Table ALGORITHM : Step 1: LXI H,2000h; to load the address in H-L register pair using LXI H from 16-bit location 2000h. Step 2: MOV C, M; to move the value of 2000h memory address value into the C register. Step 3: XRA A; to perform XOR operation. Step 4: MOV D, A; to move the accumulator value to D register. Step 5: INX H; to increase the value of the H-L register pair to get the next memory location. Step 6: ADD M; to add memory location value with accumulator. Step 7: JNC ; Jump on non-carry on INR D step 8. Step 8: INR D; Increment register by 1 for D register. Step ...