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: 
  : output  ( dev-str dev-len -- )
     open-dev ?dup IF
        \ Close old stdout:
        s" stdout" get-chosen IF
           decode-int nip nip ?dup IF close-dev THEN
        THEN
        \ Now set the new stdout:
        encode-int s" stdout" set-chosen
     THEN
  ;
  
  
negative.code: \ *     IBM Corporation - initial implementation
  \ ****************************************************************************/
  
  0 VALUE write-xt
  
  VARIABLE stdout
  
  : set-stdout ( ihandle -- )
     \ Close old stdout:
     stdout @ ?dup IF close-dev THEN
     \ Now set the new stdout:
     dup stdout !
     encode-int s" stdout" set-chosen
  ;
  
  : input  ( dev-str dev-len -- )
     open-dev ?dup IF
  