Returns the value of a given group of 2 bits into an array (0, 1, 2 or 3)
u8 cpct_get2Bits (void* array, u16 index);
(2B DE) array | Pointer to the first byte of the array |
(2B HL) index | Position of the group of 2 bits to be retrieved from the array |
call cpct_get2Bits_asm
u8 | Value of the selected group of 2 bits: 0, 1, 2 or 3 |
Returns 0, 1, 2 or 3 depending on the value of the 2-bits group at the given position (index) in the specified array. It will assume that the array elements have a size of 8 bits and also that the given position is not bigger than the number of bits in the array (size of the array multiplied by 4).
AF, DE, HL
C-binding | 38 bytes |
ASM-binding | 35 bytes |
Case | Microsecs | CPU Cycles ----------------------------------- Best (3) | 41 | 164 ----------------------------------- Worst (1) | 47 | 188 ----------------------------------- ASM-saving | -12 | -48 -----------------------------------
Start of the function code (without bindings for calling)