ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENT |
---|---|---|---|---|
4000 | 06 00 | MVI B,00H | ;clear content of B | |
4002 | 21 00 C1 | LXI H,4000H | ;pointer to 4000h | |
4005 | 4E | MOV C,M | ;move content of memory to C | |
4006 | 23 | LOOP: | INX H | ;increment HL pair |
4007 | TE | MOV A,M | ;move content of memory to Acc | |
4008 | FE FF | CPI 0FFH | ;is A equal to 0FFH? | |
400A | C2 DE C0 | JNZ AHEAD | ;jump if not zero to AHEAD | |
400D | 04 | INR B | ;increment B | |
400E | 0D | AHEAD: | DCR C | ;decrement C |
400F | C2 06 C0 | JNZ LOOP | ;jump if not zero to loop | |
4012 | 78 | MOV A,B | ;move content of B to Acc | |
4013 | 32 00 C2 | STA 4020H | ;store A at [4010h] | |
4016 | 76 | HLT | ;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