Skip to content

Commit

Permalink
Remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed Dec 19, 2024
1 parent ab60b1a commit 05ada2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ CASM instruction have the following format. If the instruction uses an immediate
// └─────┴─────┴───┴───┴───┴───┴───┴───┴───┴───┴────┴────┴────┴────┴────┴────┘
```

TODO: Explain the meaning of each element
- The first 6 fields: `off_dst`, `off_op0`, `off_op1`, `dst_reg`, `op0_reg`, `op1_src` determine the memory locations of the operands, and the destination of the result (which is not always used).
- The `res_logic` field determines how to compute the result (op1, sum, multiplication). The usage of the result depends on the following fields.
- The `opcode` field describes which operation is been performed (noop, assert, call, ret). It modifies the meaning of the following fields.
- The `pc_update` field determines how to update the program counter (advance, jump, branch, etc.).
- The `ap_update` field determines how to update the allocation pointer.

For an in-depth explanation, you can see Cairo whitepaper, page 33 - https://eprint.iacr.org/2021/1063.pdf, or checkout [our implementation](/vm/src/vm/vm_core.rs).

## Hints

Expand Down

0 comments on commit 05ada2c

Please sign in to comment.