Motorola Axiom CMD11E1 Betriebsanweisung Seite 57

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 56
4.5. ON YOUR OWN! 57
goto foo;
bar:
return 0;
}
10. Type the following C program, run it to see what the output is. Rewrite the
program in assembly language and run it on the HC11. Verify that output
of the assembly program matches the C program.
/*
I decided to use fprintf(stderr instead of printf(
as printf( and getche don’t mix well.
I am forced to use getche instead of getchar because
getchar puts the terminal in the ’cooked’ mode rather
than ’raw’ mode and there seems to be no way to uncook
the input in MS Windows.
The program as written will work on all variants of Windows
and on unix boxes if you know the right curses!
Note: getche is an exact equivalent of INCHAR in BUFFALO
To print a string, you use OUTSTRG in BUFFALO
*/
#include <stdio.h>
#include <conio.h>
char c;
main() {
foo:
fprintf(stderr,"\n\nWelcome! Your choices:\n\n");
fprintf(stderr,"\n1. Set temperature");
fprintf(stderr,"\n2. Set Speed\n"
fprintf(stderr,"\nChoice please: ");
c = getche();
Seitenansicht 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare