The first operand of BTC must be r/m, i.e. either
a memory location or a general purpose register.
EFLAGS is not a general-purpose register. Thus it
cannot be used with BTC. (Hence the NASM error.)
You will need to use PUSHFD/POPFD to move EFLAGS
from/to a general purpose register via the stack.
Note that PUSHFD/POPFD are subject to privilege
checks; application-level code may or may not be
allowed to execute them; it depends on your OS.
Last but not least, note that toggling EFLAGS.ID
is not a 100% reliable means for determining if
a processor supports CPUID. For example, certain
NexGen processors supported the instruction but
not the ID bit, and certain Cyrix processors did
require you to explicitly enable the instruction.