#include #include #include #include void *Pantalla; int x,y; void main(void) { int key = 0, key1 = 1; if ( ( Pantalla = malloc( 4096 ) ) == NULL ) return; // Guardamos el contenido de la pantalla memcpy( Pantalla, MK_FP(0xB800,0), 4096 ); x = wherex(); y = wherey(); clrscr(); cprintf( "Para Salir pulse ESC ( sc.27 )\n\r" ); cprintf( "------------------------------\n\r" ); while( key != 27 ) { if ( ( key = getch() ) ==0 ) key1 = getch(); else key1 = 0; cprintf( " % 3d % 3d \n\r", key, key1 ); } // Restauramos el contenido memcpy( MK_FP(0xB800,0), Pantalla, 4096 ); gotoxy( x, y ); free( Pantalla ); }