vextoly/cryn

[# file output and input round trip through first-class handles #]
define main
  make string "cryn_test_20.txt" path
  make string "cryn was here\n" data

  address path
  open write
  compare 0
  jump fail when less
  push
  use
  address data
  output text
  flush
  pop
  close
  compare 0
  jump fail when different

  address path
  open read
  compare 0
  jump fail when less
  push
  use
  set 0
  mark rd
  input
  compare -1
  jump readDone when equal
  convert uint8
  output
  jump rd
  mark readDone
  pop
  close
  stop

  mark fail
  set 1
  stop
end