From d6fc82c533a07c65b3a6fc535336c0d9ad5a8f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 31 Oct 2020 18:54:43 +0100 Subject: [PATCH] improve readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 24c92b9..4bc30fe 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,8 @@ The different ways to specify a value can be grouped as "reads" and "writes": - `RW` - intersection of the two sets, capable of reading and writing: `REG`, `SYM`, `@REG`, `@SYM` Objects (`@reg`, `@sym`) can be read or written as if they were a register, but only if the referenced object supports it. -Other objects may produce a runtime fault or set the INVALID flag. +Other objects may produce a runtime fault or set the INVALID flag. +The object syntax is also used to read values yielded by a generator-like coroutine. In the instruction lists below, I will use the symbols `Rd` for reads, `Wr` for writes, `RW` for read-writes, and `@Obj` for object handles, with optional description after an apostrophe, such as: `(add Wr'dst Rd'a Rd'b)`. @@ -473,9 +474,15 @@ Jumping to a label is always safer than a manual skip. ; The arguments are passed as argX. Return values are stored in resX registers. (call PROC Rd...) -; Exit the current routine with return values +; Spawn a coroutine. The handle is stored in the output register. +(spawn Wr'handle PROC Rd...) + +; Exit the current routine (or coroutine) with return values (ret Rd...) +; Wait for a coroutine to complete, read its return values and delete it. +(join @Obj) + ; Generate a run-time fault with a debugger message (fault) (fault message)