anchor.diff:           2drop r> drop false EXIT \ unknown device_type cleanup return-stack, return false
         THEN
      ELSE
  -      \ stdin not set, return false
  -      false
  +      serial-key?
      THEN
   ;
   
  
positive.code: 
  : input  ( dev-str dev-len -- )
     open-dev ?dup IF
        \ Close old stdin:
        s" stdin" get-chosen IF
           decode-int nip nip ?dup IF close-dev THEN
        THEN
        \ Now set the new stdin:
        encode-int s" stdin"  set-chosen
     THEN
  ;
  
  
negative.code: \ *     IBM Corporation - initial implementation
  \ ****************************************************************************/
  
  0 VALUE read-xt
  0 VALUE write-xt
  
  VARIABLE stdin
  VARIABLE stdout
  
  : set-stdin ( ihandle -- )
     \ Close old stdin:
     stdin @ ?dup IF close-dev THEN
     \ Now set the new stdin:
     dup stdin !
     encode-int s" stdin"  set-chosen
  ;
  
  : set-stdout ( ihandle -- )
     \ Close old stdout:
  