Skip to content

Commit

Permalink
fix(docs): Consistently use advstack for the advice stack
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Sep 23, 2024
1 parent 2ef9705 commit a0095ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/user_docs/assembly/io_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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* <br> - *(n cycles)* | [ ... ] | [a, ... ] | $a \leftarrow stack.pop()$ <br> Pops $n$ values from the advice stack and pushes them onto the operand stack. Valid for $n \in \{1, ..., 16\}$. <br> Fails if the advice stack has fewer than $n$ values. |
| adv_loadw <br> - *(1 cycle)* | [0, 0, 0, 0, ... ] | [A, ... ] | $A \leftarrow stack.pop(4)$ <br> Pop the next word (4 elements) from the advice stack and overwrites the first word of the operand stack (4 elements) with them. <br> Fails if the advice stack has fewer than $4$ values. |
| adv_push.*n* <br> - *(n cycles)* | [ ... ] | [a, ... ] | $a \leftarrow advstack.pop()$ <br> Pops $n$ values from the advice stack and pushes them onto the operand stack. Valid for $n \in \{1, ..., 16\}$. <br> Fails if the advice stack has fewer than $n$ values. |
| adv_loadw <br> - *(1 cycle)* | [0, 0, 0, 0, ... ] | [A, ... ] | $A \leftarrow advstack.pop(4)$ <br> Pop the next word (4 elements) from the advice stack and overwrites the first word of the operand stack (4 elements) with them. <br> Fails if the advice stack has fewer than $4$ values. |
| adv_pipe <br> - *(1 cycle)* | [C, B, A, a, ... ] | [E, D, A, a', ... ] | $[D, E] \leftarrow [adv\_stack.pop(4), adv\_stack.pop(4)]$ <br> $a' \leftarrow a + 2$ <br> 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$.<br> 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.
Expand Down

0 comments on commit a0095ce

Please sign in to comment.