COUNTING OF OCCURENCE IN 8085

ADDRESSOPCODELABELMNEMONICSCOMMENT
400006 00MVI B,00H;clear content of B
400221 00 C1LXI H,4000H;pointer to 4000h
40054EMOV C,M;move content of memory to C
400623LOOP:INX H;increment HL pair
4007TEMOV A,M;move content of memory to Acc
4008FE FF CPI 0FFH;is A equal to 0FFH?
400AC2 DE C0 JNZ AHEAD;jump if not zero to AHEAD
400D04INR B;increment B
400E0DAHEAD:DCR C;decrement C
400FC2 06 C0JNZ LOOP;jump if not zero to loop
401278 MOV A,B;move content of B to Acc
401332 00 C2 STA 4020H;store A at [4010h]
401676HLT;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