ZealOS/src/Doc/Bit.DD

15 lines
630 B
Text
Raw Normal View History

2020-02-15 20:01:48 +00:00
$FG,5$These take a pointer to a bit field.$FG$
$WW,1$$FG,2$Bt$FG$: Bit Test
$FG,2$Bts$FG$: Bit Test and Set to one
2020-02-16 00:54:39 +00:00
$FG,2$Btr$FG$: Bit Test and Reset to zero
2020-02-15 20:01:48 +00:00
$FG,2$Btc$FG$: Bit Test and Compliment (toggle)
2020-02-16 03:41:28 +00:00
$FG,2$BEqual$FG$: Set bit to value.
2020-02-15 20:01:48 +00:00
$FG$Bit operations are "atomic", no interrupt between the reading and writing the bit, important when multitasking. For multicore use "locked" forms.$FG$
$FG,5$These don't take a pointer, but the actual field.$FG$
$FG,2$Bsf$FG$: Bit Scan Fwd (Pos of first low one bit or -1)
$FG,2$Bsr$FG$: Bit Scan Rev (Pos of first high one bit or -1)
2020-02-16 00:20:04 +00:00
$FG,2$BCount$FG$: Bit Count (Count of set bits)