FIND LARGEST NUMBER IN 8085

WRITE THIS IN THE WRITING SIDE OF THE JOURNAL

ADDRESSOPCODELABELMNEMONICSCOMMENT
400021 00 C1LXI H,4000H;memory pointer
40033E 00MVI A,00;clear accumulator
40050E 0AMVI C,10;set counter C=10
4007BELOOP:CMP M;compare mem. with Acc.
4008D2 0C C0JNC AHEAD;if not carry move to AHEAD
400BTEMOV A,M;move content of M to Acc.
400C23AHEAD:INX H;increment HL pair
400D0DDCR C;decrement C
400EC2 07 C0JNZ LOOP;jump if not zero to loop
401132 00 C2 STA 4010H;store Acc. to 4010h
401476HLT;8085 go in halt state

) Sign Flag is reset: Result is positive
) Zero flag is set: result is set to zero after the execution of arithmetic or logical operation
) auxiliary carry flag is set: there is a carry from bit D3 to D4
) parity flag is set: result stored in accumulator contain even number of 1’s
) carry flag is result: no carry or borrow bit during the execution of arithmetic operation

WRITE THIS IN THE BLANK SIDE OF THE JOURNAL

Scroll to Top