Generating bitmaps with specified order.
Obtains the value of a specified bit position from an integer and creates a bitmap of the specified order.
The value corresponding to the bit position 0..31 specified by the subsequent variable number parameter is extracted from the value specified in the parameter bm. The extracted values are arranged in parameter order and returned as a bitmap.
The bitmap is ordered with the first parameter as the upper bit and the last parameter as bit 0.
In the example, taking out bits 4,2,1,0 of b1 yields (1,0,1,0). This is calculated as 0x10 as b1010.
There are situations where values are referenced and set in various bitmaps, such as the status of IO ports (DI, DO), in order to simplify the description.