>> According to Assembler Templates >> (https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#AssemblerTemplate), >> the save of the EBX register and the call to CPUID can be reordered, >> even with volatile. > > No, it doesn't say that. It says that asm statements may not be > consecutive. This is one asm statement. > Thanks Andrew. I parsed this incorrectly (I managed to invert it): Do not expect a sequence of asm statements to remain perfectly consecutive after compilation, even when you are using the volatile qualifier. If certain instructions need to remain consecutive in the output, put them in a single multi-instruction asm statement. Sorry about that. Jeff