WRITE THIS IN THE WRITING SIDE OF THE JOURNAL
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENT |
---|---|---|---|---|
4000 | 21 00 C1 | LXI H,4000H | ;memory pointer | |
4003 | 3E 00 | MVI A,00 | ;clear accumulator | |
4005 | 0E 0A | MVI C,10 | ;set counter C=10 | |
4007 | BE | LOOP: | CMP M | ;compare mem. with Acc. |
4008 | D2 0C C0 | JNC AHEAD | ;if not carry move to AHEAD | |
400B | TE | MOV A,M | ;move content of M to Acc. | |
400C | 23 | AHEAD: | INX H | ;increment HL pair |
400D | 0D | DCR C | ;decrement C | |
400E | C2 07 C0 | JNZ LOOP | ;jump if not zero to loop | |
4011 | 32 00 C2 | STA 4010H | ;store Acc. to 4010h | |
4014 | 76 | HLT | ;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