From a0095cede391f463e33dbeb6f4d2f589d5befad4 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 23 Sep 2024 15:05:36 +0200 Subject: [PATCH] fix(docs): Consistently use `advstack` for the advice stack --- docs/src/user_docs/assembly/io_operations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/user_docs/assembly/io_operations.md b/docs/src/user_docs/assembly/io_operations.md index 4aa967ee6..fc8c08608 100644 --- a/docs/src/user_docs/assembly/io_operations.md +++ b/docs/src/user_docs/assembly/io_operations.md @@ -37,8 +37,8 @@ As mentioned above, nondeterministic inputs are provided to the VM via the advic | Instruction | Stack_input | Stack_output | Notes | | -------------------------------- | ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| adv_push.*n*
- *(n cycles)* | [ ... ] | [a, ... ] | $a \leftarrow stack.pop()$
Pops $n$ values from the advice stack and pushes them onto the operand stack. Valid for $n \in \{1, ..., 16\}$.
Fails if the advice stack has fewer than $n$ values. | -| adv_loadw
- *(1 cycle)* | [0, 0, 0, 0, ... ] | [A, ... ] | $A \leftarrow stack.pop(4)$
Pop the next word (4 elements) from the advice stack and overwrites the first word of the operand stack (4 elements) with them.
Fails if the advice stack has fewer than $4$ values. | +| adv_push.*n*
- *(n cycles)* | [ ... ] | [a, ... ] | $a \leftarrow advstack.pop()$
Pops $n$ values from the advice stack and pushes them onto the operand stack. Valid for $n \in \{1, ..., 16\}$.
Fails if the advice stack has fewer than $n$ values. | +| adv_loadw
- *(1 cycle)* | [0, 0, 0, 0, ... ] | [A, ... ] | $A \leftarrow advstack.pop(4)$
Pop the next word (4 elements) from the advice stack and overwrites the first word of the operand stack (4 elements) with them.
Fails if the advice stack has fewer than $4$ values. | | adv_pipe
- *(1 cycle)* | [C, B, A, a, ... ] | [E, D, A, a', ... ] | $[D, E] \leftarrow [adv\_stack.pop(4), adv\_stack.pop(4)]$
$a' \leftarrow a + 2$
Pops the next two words from the advice stack, overwrites the top of the operand stack with them and also writes these words into memory at address $a$ and $a + 1$.
Fails if the advice stack has fewer than $8$ values. | > **Note**: The opcodes above always push data onto the operand stack so that the first element is placed deepest in the stack. For example, if the data on the stack is `a,b,c,d` and you use the opcode `adv_push.4`, the data will be `d,c,b,a` on your stack. This is also the behavior of the other opcodes.