Source program
LXI SP, 27FFH ; Initialize stack pointer
LDA 2200H ; Get the number
CPI 02H ; Check if number is greater than 1
JC LAST
MVI D, 00H ; Load number as a result
MOV E, A
DCR A
MOV C,A ; Load counter one less than number
CALL FACTO ; Call subroutine FACTO
XCHG ; Get the result in HL
SHLD 2201H ; Store result in the memory
JMP END
LAST: LXI H, 000lH ; Store result = 01
END: SHLD 2201H
HLT
Subroutine Program:
FACTO:LXI H, 0000H
MOV B, C ; Load counter
BACK: DAD D
DCR B
JNZ BACK ; Multiply by successive addition
XCHG ; Store result in DE
DCR C ; Decrement counter
CNZ FACTO ; Call subroutine FACTO
RET ; Return to main program
Chat with our AI personalities
The most significant difference between the Intel 8085 and 8086 microprocessors is that the 8085 is an 8-bit system and the 8086 is a 16-bit system. This difference allows the 8086 system to have a much larger set of operational instructions and can make calculations to more significant places. Note: the 8085 processor does have two 16-bit registers. The pointer and the program counter.
sample program in sum of the series using the formula for s=n/2[2a+{n-1}d] in 8085
In the 8085, if the accumulator starts as 00H, then adding 89H and 79H to it results in a value of 02H with CARRY set.
The factors of 8085 are 1, 3, 5, 7, 11, 15, 21, 33, 35, 49, 55, 77, 105, 147, 165, 231, 245, 385, 539, 735, 1155, 1617, 2695, and 8085 8085 = 3*5*7*7*11, so the prime factors are 3, 5, 7 and 11. 7 is used twice!
The name 8085 was given to the next generation of the 8080 to indicate 1.) that it was a next generation device and 2.) that it only required a single +5V power supply to operate.