WRITE THIS IN THE WRITING SIDE OF THE JOURNAL
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENT |
---|---|---|---|---|
4000 | AF | XRA A | ;reset carry flag | |
4001 | 06 04 | MVI B,04H | ;set counter in reg. B | |
4003 | 21 40 40 | LXI H, 4040H | ;set memory pointer in HL | |
4006 | 11 50 40 | LXI D,4050H | ;set memory pointer in DE | |
4009 | 1A | UP: | LDAX D | ;load Acc. with data from address of DE |
400A | 8E | ADC M | ;add it with data from memory pointed by HL | |
400B | 77 | MOV M,A | ;store the result | |
400C | 13 | INX D | ;Increment address in DE | |
400D | 23 | INX H | ;increment address in HL | |
400E | 05 | DCR B | ;decrement B | |
400F | C2 09 04 | JNZ UP | ;jump if not zero to up | |
4012 | 76 | HLT | ;stop |
Result




) 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