/* * PWTEST.C * * Source file for PMODE/W -fix example. * * HackRight 1995 Teemu Kalvas * */ #include #include #include /* I didn't want to start messing around with startup files. Therefore the fix module contains main() which calls user_main(). */ int user_main( void ) { unsigned char buffer[3]; void (*code)(); /* Interesting illegal actions can be constructed from these few lines of code. Feel free to experiment, and remember that usually your machine will recover. */ #if 0 buffer[0] = buffer[1] = buffer[2] = 0xff; /* Illegal opcode. */ code = (void(*)())buffer; /* Point to 0xffffff. */ code = (void(*)())0x12345678; /* Point to nowhere. */ (*code)(); /* Execute! */ #endif *(int*)0x12345678 = 0; /* Write to nowhere. */ /* You are not supposed to reach this code. */ return 0; }