@instruction<EOL><INDENT>def BTS(cpu, dest, src):<DEDENT>
if dest.type == '<STR_LIT>':<EOL><INDENT>value = dest.read()<EOL>pos = src.read() % dest.size<EOL>cpu.CF = value & (<NUM_LIT:1> << pos) == <NUM_LIT:1> << pos<EOL>dest.write(value | (<NUM_LIT:1> << pos))<EOL><DEDENT>elif dest.type == '<STR_LIT>':<EOL><INDENT>addr, pos = cpu._getMemoryBit(dest, src)<EOL>base, size, ty = cpu.get_descriptor(cpu.DS)<EOL>addr += base<EOL>value = cpu.read_int(addr, <NUM_LIT:8>)<EOL>cpu.CF = value & (<NUM_LIT:1> << pos) == <NUM_LIT:1> << pos<EOL>value = value | (<NUM_LIT:1> << pos)<EOL>cpu.write_int(addr, value, <NUM_LIT:8>)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError(f"<STR_LIT>")<EOL><DEDENT>
Bit test and set.

Selects the bit in a bit string (specified with the first operand, called
the bit base) at the bit-position designated by the bit offset operand
(second operand), stores the value of the bit in the CF flag, and sets
the selected bit in the bit string to 1.

:param cpu: current CPU.
:param dest: bit base operand.
:param src: bit offset operand.