Affinity is not determined by the state of the CPU and therefore cannot be changed by assembly (separately). You need OS participation. And each OS will have a special challenge for this.
: , , , . .
( , , , , ), , , , , runqueue () runqueue .
, ? . , , , , , , , .
. Linux 2.6.29 arch/x86/kernel/smpboot.c function do_boot_cpu(), CPU APIC.