WRITE THIS IN THE WRITING SIDE OF THE JOURNAL
| ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENT |
|---|---|---|---|---|
| 4000 | 21 50 40 | LXI H,4050H | ;set memory pointer to HL | |
| 4003 | 7E | MOV A,M | ;move mem. to acc. | |
| 4004 | 23 | INX H | ;increment HL address | |
| 4005 | 06 64 | MVI B,64H | ;set reg B = 64H | |
| 4007 | 36 FF | MVI M,0FFH | ;set reg. E=0FFH | |
| 4009 | 34 | UP: | INR M | ;increment memory data |
| 400A | 90 | SUB B | ;subtract A – B | |
| 400B | D2 09 04 | JNC UP | ;jump to UP | |
| 400E | 80 | ADD B | ;add A + B | |
| 400F | 23 | INX H | ;increment HL address | |
| 4010 | 06 0A | MVI B,0AH | ;load B = 0AH | |
| 4012 | 36 FF | MVI M,0FFH | ;load mem. =0FFH | |
| 4014 | 34 | UP1: | INR M | ;increment memory data |
| 4015 | 90 | SUB B | ;subtract A – B | |
| 4016 | D2 14 40 | JNC UP1 | ;jump to UP1 | |
| 4019 | 80 | ADD B | ;add A + B | |
| 401A | 23 | INX H | ;increment HL address | |
| 401B | 77 | MOV M,A | ;move mem. to acc. | |
| 401C | 76 | HLT | ;entering 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
