//------------------------------------------------------------------- // illegal.cpp // // This program attempts to execute the Intel 'UD2' opcode (an // officially documented 'Undefined Opcode' instruction) which // then triggers the Undefined Opcode exception (interrupt 6). // // to compile: $ g++ illegal.cpp -o illegal // to execute: $ ./illegal // // programmer: ALLAN CRUSE // written on: 15 SEP 2009 //------------------------------------------------------------------- int main( int argc, char **argv ) { asm(" ud2 "); }