ide-tape: simplify read/write functions