about summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorNaren Ratan <narenratan@gmail.com>2019-11-19 00:20:31 +0000
committerNaren Ratan <narenratan@gmail.com>2019-11-19 00:20:31 +0000
commit032204d951e191771ce6cd99ecf5118ee1e1dce5 (patch)
treeb8e1ee590a753a0da3ac2c32bc75d230e11e4e8b /examples
parentcb51cf13682476f5afe91c638bef7e50c232d117 (diff)
downloadjonesforth_arm64_apl-032204d951e191771ce6cd99ecf5118ee1e1dce5.tar.gz
Add file_io.f example
Diffstat (limited to 'examples')
-rw-r--r--examples/file_io.f10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/file_io.f b/examples/file_io.f
new file mode 100644
index 0000000..b9cce38
--- /dev/null
+++ b/examples/file_io.f
@@ -0,0 +1,10 @@
+/ Example file IO using syscalls /
+
+/ Open a file read only with open ⍐ syscall /
+0 H" input.txt" ↓ ⍐
+
+/ Read one byte with read ⍇ syscall /
+↑ 1 H ⌽ ⍇
+
+/ Close file with close ⍗ syscall /
+↓ ⍗