// Motorola 68HC12 EVB Test Program Hello.c // RPK // August 13, 2000 // // // This code was written and tested using Introl C 4.0. // #includes #include #include #include void __main () { char *mess = "HI"; int choice, n; while(1) { DB12->printf("Hello World!\n\n\r"); // DB12->printf("\n\r"); DB12->printf("( greetings from Russell P. Kraft )\n\n\n\r"); DB12->printf("1=repeat, 2=clear, 0=quit.\n\n\r"); // Menu of choices choice=DB12->getchar(); // DB12->putchar(choice); // select which option to run if (choice == '0') return; // exit(1); else if(choice == '1') DB12->printf("\n\nHere we go again.\n\n\r"); else if(choice == '2') // clear the screen with [2J DB12->printf("\033[2J"); else { // inform the user how bright he is // The overwriting of the first parameter gets around a bug in the // printf function that incorrectly outputs the first value. DB12->printf("\n%c\rA %c is not a valid choice.\n\r",choice,choice); // %s doesn't seem to work at all // *mess = "HI"; // n=DB12->printf("%s\rA %s is no good\n\n\r",mess, mess); DB12->printf("A "); DB12->putchar(choice); DB12->printf(" is not a valid choice.\n\n\r"); } } }