         Edinburgh IMP77 Compiler - Version 8.4

    1  %begin
    2  
    3    %integerfn getchar
    4      %integer sym
    5      readsymbol(sym)
    6      printstring("Call returned "); printsymbol(sym); newline
    7      %result = sym
    8    %end
    9    
   10    printstring("Please enter the word BUG when I ask for data:"); newline
   11  
   12    %if 'A' <= getchar <= 'C' %start
   13      printstring("Test successful."); newline
   14    %else
   15      printstring("Test failed - getchar was called twice."); newline
   16    %finish
   17  
   18  %endofprogram

   19 Statements compiled
