implement "lds" for objects (buffers, cin)

This commit is contained in:
2020-10-15 20:38:43 +02:00
parent 1e6e45ea72
commit 2d4f6b4af1
13 changed files with 197 additions and 40 deletions
+7
View File
@@ -0,0 +1,7 @@
(
(mkbf r0 "Lazy fox\n")
(lds @cout @r0) ; buffers implement lds as a non-consuming read from start to end
(lds @cout @r0)
(lds @cout @r0)
(halt)
)
+8
View File
@@ -0,0 +1,8 @@
(
; Read all stdin and print it reversed
(mkbf r0)
(lds @r0 @cin) ; cin implements the "lds" operation
(bfrev @r0)
(lds @cout @r0)
(del @r0)
)