Sets the value of a selected group of 2 bits into a bitarray to [0-3]
void cpct_set2Bits (void* array, u16 index, u8 value)
(2B DE) array | Pointer to the first byte of the array |
(2B HL) index | Position of the group of 2 bits in the array to be modified |
(1B C ) value | New value {0, 1, 2, 3} for the group of 2 bits at the given position |
call cpct_set2Bits_asm
Set the new value of the 2-bits group at the given position (index) in the specified array. This function assumes that the array elements have a size of 8 bits and also that the given index is not bigger than the number of 2-bits groups in the array (size of the array multiplied by 4). The value to be set is also assumed to be in the range [0-3] but other values will “work” (just the 2 Least Significant Bits will be used, so value module 4 will be inserted).
AF, BC, DE, HL
64 bytes
Case | Cycles | microSecs (us) ------------------------------- Best (0) | 228 | 57.00 ------------------------------- Worst (1) | 260 | 65.00 ------------------------------- Asm saving | -84 | -21.00 -------------------------------