Factorial Program 8085 Microprocessor
Hi,maggie, a 2nd year cse student in methodist college of engg and tech hydrebad India.Here's the program, please correct it if i am wrong lxi h,4150 mov b,m //get divi dent in b-reg mvi c,00 // clear c-reg for quotient inx h mov a,m //get the divisor in A reg Next cmp b // compare A reg with b reg jc loop // jump on carry to loop sub b // sub A reg from b reg inr c// increment content of register c jmp NEXT// jump to next loop sta 4152// store the remainder mov a,c sta 4153//store the quotient hlt. This is a program to add two 16 bit numbers in which one number is stored at 8050 and 8051 and the 2nd number is stored at 8060 and 8061.. And the result is at 807 0 and 8071 program: LDA 8051H LXI H,8061H MOV B,M MVI E,00H ADD B JNC L1 INR E L1:STA 8071H LDA 8050H LXI H,8060H MOV B,M ADD E ADD B MVI E,00H JNC L2 INR E L2:STA 8070H MOV A,E STA 8072H HLT **************************************************************** LHLD 4000H: Get first I6-bit number XCHG: Save first I6-bit number in DE LHLD 4002H: Get second I6-bit number in HL DAD D: Add DE and HL SHLD 4004H: Store I6-bit result in memory locations 4004H and 4005H. Ringo Pro Crack there. HLT: Terminate program execution Sample problem: (4000H) = 15H (4001H) = 1CH (4002H) = B7H (4003H) = 5AH Result = 1C15 + 5AB7H = 76CCH (4004H) = CCH (4005H) = 76H ************************************************ROCK FRANCIS***. Lhld 4000h xchg lhld 4002h mov a,e sub l mov l,a mov a,d sub h mov h,a shld 4004h hlt ******************************************************************* * LHLD 4000H: Get first 16-bit number in HL XCHG: Save first 16-bit number in DE LHLD 4002H: Get second 16-bit number in HL MOV A, E: Get lower byte of the first number SUB L: Subtract lower byte of the second number MOV L, A: Store the result in L register MOV A, D: Get higher byte of the first number SBB H: Subtract higher byte of second number with borrow MOV H, A: Store l6-bit result in memory locations 4004H & 4005H. Sierra Vista Mall Massage Programs more. SHLD 4004H: Store l6-bit result in memory locations 4004H & 4005H. Ppt Template Air Asia. HLT: Terminate program execution.