From abd1d286cba15b025bb52fe5d820ed8b2b82807b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Gonz=C3=A1lez=20Calder=C3=B3n?= Date: Thu, 19 Dec 2024 14:46:15 -0300 Subject: [PATCH] Remove TODO --- docs/vm/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/vm/README.md b/docs/vm/README.md index d39ed017bf..611b4e55e4 100644 --- a/docs/vm/README.md +++ b/docs/vm/README.md @@ -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 (sum, multiplication, etc.). The usage of the result depends on the following fields. +- The `opcode` field describes which operation is been performed (assert, ret, call, etc.). It modifies the meaning of the following fields. +- The `pc_update` field determines how to update the program counter (absolute jump, conditional jump, relative jump, 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