Flush the   keyboard   buffer.

This reads characters from the keyboard input and
discards them until there are no more currently buffered,  
and then allows the program to continue.

The program must not wait for users to type anything.

PROC Wait(BYTE frames)
  BYTE RTCLOK=$14
  frames==+RTCLOK
  WHILE frames#RTCLOK DO OD
RETURN
 
PROC Main()
  BYTE CH=$02FC ;Internal hardware value for last key pressed
 
  PrintE("Program is halted for 200 frames.")
  PrintE("Type character to fill the buffer.")
  Wait(200)
  PutE()
 
  DO
    IF CH=$FF THEN
      PrintE("The buffer is empty.")
      EXIT
    ELSE
      PrintF("The buffer stores internal key: %B.%E",CH)
      PrintE("Flush the buffer.")
      CH=$FF
    FI
  OD
RETURN