LD C,A XOR A LOOP: ADD A,C DJNZ LOOP
LD D,0 LD E,B LD L,D LD H,D LD B,8 LOOP: SLA L RL H RLCA JP NC,SKIP_ADD ADD HL,DE SKIP_ADD: DJNZ LOOP