//------------------------------------------------------------------- // showmsw.cpp // // This program executes the unprivileged 'smsw' instruction, // to get the current value of the MSW (Machine Status Word), // and then displays that value as a string of binary digits. // // programmer: ALLAN CRUSE // written on: 26 JAN 2004 //------------------------------------------------------------------- #include // for printf() int main( void ) { short msw; // word-size storage-location asm(" smsw %0 " : "=m" (msw) ); // in-line assembly language char message[] = " MSW=xxxxxxxxxxxxxxxx "; for (int i = 0; i < 16; i++) message[ 20-i ] = ( msw & (1<