anchor.diff:  
   
   1 BUFFER: (term-io-char-buf)
  +
  +: term-io-emit ( char -- )
  +    write-xt IF
  +       (term-io-char-buf) c!
  +       (term-io-char-buf) 1 write-xt stdout @ call-package
  +       drop
  +    ELSE
  +       serial-emit
  +    THEN
  +;
  +
  +' term-io-emit to emit
   
   : term-io-key  ( -- char )
      s" stdin" get-chosen IF
  
positive.code: \ *     IBM Corporation - initial implementation
  \ ****************************************************************************/
  
  
  : input  ( dev-str dev-len -- )
     open-dev ?dup IF
  
negative.code: 
  : output  ( dev-str dev-len -- )
     open-dev ?dup IF
        \ find new ihandle and xt handle
        dup s" write" rot ihandle>phandle find-method
        0= IF
           drop
           cr ." Cannot find the write method for the given output console " cr
           EXIT
        THEN
        to write-xt
        set-stdout
     THEN
  ;
  
  