'--------------------------------------------------------------------------------------------------------- 'CPIR LMM. cpir_lmm rdword hl_temp, h_reg rdbyte de_temp, a_reg 'Abused to keep the accumulator rdword bc_temp, b_reg :loop mov address, hl_temp call #read_memory_byte mov alu, de_temp mov aux, alu sub alu, data_8 wz, wc add hl_temp, #1 'Advance the pointer sub bc_temp, #1 wz 'Decrement counter... if_nz and alu, #$ff wz if_nz sub lmm_pc, #(9*4) xor aux, alu 'Final comparison xor aux, data_8 test aux, #aux_bit wz muxnz flags, #aux_bit and alu, #$ff wz muxz flags, #zero_bit muxc flags, #carry_bit wrword hl_temp, h_reg 'Update the registers wrword bc_temp, b_reg jmp #fetch '---------------------------------------------------------------------------------------------------------