Disassembly notes
Just some self made notes from disassembling that could be handy.
Notes
bts reg, val-> Translates to intrinsic_interlockedbittestandset. Observed interacting with a union field where 0x1D is passed over a union type. This atomic operations first divides by the width (8 bytes) to give the union section, and then does val mod width, aka 1dh % 8 to get the bit index to set to 1. Calling the intrinsic gives a return value of the original value of the specified bit. So example:bts [rax], 1dh= 29⁄8 = bit is in the 3rd quadrant,29 mod 8= 5, thus the 5th bit.