FIND SMALLEST NUMBER IN 8085

WRITE THIS IN THE WRITING SIDE OF THE JOURNAL

ADDRESSOPCODELABELMNEMONICSDESCRIPTION
400021 00 C1LXI H,4000H;memory pointer
40033E FFMVI A,0FFH;clear Acc.
40050E 0A MVI C,0AH;set C pointer to 10
4007BELOOP:CMP M;compare M with A
4008DA 0C C0 JC AHEAD;jump if carry 0 to AHEAD
400B7EMOV A,M;move content of Mem. to Acc.
400C23AHEAD:INX H;Increment HL pair
400D0DDCR C;decrement C
400EC2 07 C0JNZ LOOP;jump if not zero to LOOP
401132 00 C2STA 4010H;store Acc
401476HLT;8085 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