This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LXI H, 8050H ; Memory Location | |
LXI B, 0000H ; Carry-Sum even | |
LXI D, 0000H; Carry-Sum odd | |
TOP: MOV A, M | |
RRC ; Rotate right to check odd or even | |
JC ODD ; if 1 in carry then jump to ODD | |
MOV A, M; as we rotated we can re-rotate or simply move | |
ADD C ; sum in accumulator, in first instance it is 0 | |
MOV C,A ; move sum in sum register |