//------------------------------------------------------------------- // cr0.cpp // // This program is for use in testing our 'nocache.c' module. // It uses a pair of unprivileged processor-specific machine- // instructions to obtain the current contents of the Pentium // processor's Control Register 0, and displays that value in // hexadecimal format. // // programmer: ALLAN CRUSE // written on: 12 SEP 2004 //------------------------------------------------------------------- #include // for printf() unsigned long regCR0; // storage for Control Register value int main( int argc, char **argv ) { asm(" smsw %eax " ); asm(" movl %eax, regCR0 " ); printf( "\n\tCR0=%08lX \n\n", regCR0 ); }