Z80 shortest version LD DE,TABLE ; 10 LD HL,RESULT ; 10 LD B, 4 ; 7 ; main code below loop: LD A, (DE) ; 7 LD (HL),A ; 7 INC DE ; 6 LD A, (DE) ; 7 RLD ; 18 INC DE ; 6 INC HL ; 6 DJNZ loop ; 13 / 8 ; end of main code RET ; 10 table: db 02,06,08,10,02,01,09,12 result: db 0,0,0,0 70 cycles (65 cycles for last iteration) 27 cycles setting up 10 cycles to return to calling program Z80 quickest version - Normal LD HL,TABLE LD DE,RESULT LD B,4 loop: LD A,(HL) ; 7 RLCA ; 4 RLCA ; 4 RLCA ; 4 RLCA ; 4 INC HL ; 6 OR (HL) ; 7 LD (DE),A ; 7 INC DE ; 6 INC HL ; 6 DJNZ LOOP ; 13 / 8 68 cycles (63 cycles for last iteration) Z80 quickest version - Page alligned LD HL,TABLE ; 10 LD DE,RESULT ; 10 LD B,4 ; 7 loop: LD A,(HL) ; 7 RLCA ; 4 RLCA ; 4 RLCA ; 4 RLCA ; 4 INC L ; 4 OR (HL) ; 7 LD (DE),A ; 7 INC E ; 4 INC L ; 4 DJNZ LOOP ; 13 / 8 RET ; 10 ORG 0200h table: db 02,06,08,10,02,01,09,12 ORG 0300h result: db 0,0,0,0 62 cycles (57 cycles for last iteration) Z80 16bit version LD HL,TABLE LD DE,RESULT LD B,4 loop: LD A,(HL) ; 7 RLCA ; 4 RLCA ; 4 RLCA ; 4 RLCA ; 4 INC HL ; 6 OR (HL) ; 7 LD (DE),A ; 7 INC DE ; 6 INC HL ; 6 DEC BC ; 6 LD A,B ; 4 OR C ; 4 JP NZ,LOOP ; 10 - JR NZ takes 12 cycles per iteration. 79 cycles 8080 version LXI H,TABLE ; 10 LXI D,RESULT ; 10 MVI B,4 ; 7 loop: MOV A,M ; 7 RLC ; 4 RLC ; 4 RLC ; 4 RLC ; 4 INX H ; 6 ORA M ; 7 STAX D ; 7 INX D ; 6 INX H ; 6 DCR B ; 4 JNZ LOOP ; 10 RET Same cycles as the last Z80 version.