diff --git a/docs/src/user_docs/assembly/flow_control.md b/docs/src/user_docs/assembly/flow_control.md index 0b23a268f..0075f1d33 100644 --- a/docs/src/user_docs/assembly/flow_control.md +++ b/docs/src/user_docs/assembly/flow_control.md @@ -82,9 +82,9 @@ where `instructions` can be a sequence of any instructions, including nested con 1. Pops the top item from the stack. 2. If the value of the item is $1$, `instructions` in the loop body are executed. - a. After the body is executed, the stack is popped again, and if the popped value is $1$, the body is executed again. - b. If the popped value is $0$, the loop is exited. - c. If the popped value is not binary, the execution fails. + 1. After the body is executed, the stack is popped again, and if the popped value is $1$, the body is executed again. + 2. If the popped value is $0$, the loop is exited. + 3. If the popped value is not binary, the execution fails. 3. If the value of the item is $0$, execution of loop body is skipped. 4. If the value is not binary, the execution fails. diff --git a/docs/src/user_docs/assembly/io_operations.md b/docs/src/user_docs/assembly/io_operations.md index 697d6ffc9..4aa967ee6 100644 --- a/docs/src/user_docs/assembly/io_operations.md +++ b/docs/src/user_docs/assembly/io_operations.md @@ -74,7 +74,7 @@ Memory is guaranteed to be initialized to zeros. Thus, when reading from memory | mem_storew
- *(1 cycle)*
mem_storew.*a*
- *(2-3 cycles)* | [a, A, ... ] | [A, ... ] | $A \rightarrow mem[a]$
Stores the top four elements of the stack in memory at address $a$. If $a$ is provided via the stack, it is removed from the stack first.
Fails if $a \ge 2^{32}$ | | mem_stream
- *(1 cycle)* | [C, B, A, a, ... ] | [E, D, A, a', ... ] | $[E, D] \leftarrow [mem[a], mem[a+1]]$
$a' \leftarrow a + 2$
Read two sequential words from memory starting at address $a$ and overwrites the first two words in the operand stack. | -The second way to access memory is via procedure locals using the instructions listed below. These instructions are available only in procedure context. The number of locals available to a given procedure must be specified at [procedure declaration](./code_organization.md#procedures) time, and trying to access more locals than was declared will result in a compile-time error. The number of locals per procedure is not limited, but the total number of locals available to all procedures at runtime must be smaller than $2^{32}$. +The second way to access memory is via procedure locals using the instructions listed below. These instructions are available only in procedure context. The number of locals available to a given procedure must be specified at [procedure declaration](./code_organization.md#procedures) time, and trying to access more locals than was declared will result in a compile-time error. A procedure can have at most $2^{16}$ locals, and the total number of locals available to all procedures at runtime is limited to $2^{30}$. | Instruction | Stack_input | Stack_output | Notes | | ------------------------------------ | ------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -85,4 +85,4 @@ The second way to access memory is via procedure locals using the instructions l Unlike regular memory, procedure locals are not guaranteed to be initialized to zeros. Thus, when working with locals, one must assume that before a local memory address has been written to, it contains "garbage". -Internally in the VM, procedure locals are stored at memory offset stating at $2^{30}$. Thus, every procedure local has an absolute address in regular memory. The `locaddr.i` instruction is provided specifically to map an index of a procedure's local to an absolute address so that it can be passed to downstream procedures, when needed. +Internally in the VM, procedure locals are stored at memory offset starting at $2^{30}$. Thus, every procedure local has an absolute address in regular memory. The `locaddr.i` instruction is provided specifically to map an index of a procedure's local to an absolute address so that it can be passed to downstream procedures, when needed.