feat: implement 0x58 - PC #73
Labels
cairo
cairo
Context: isolated
no previous knowledge of the codebase required
Type: feature
a new feature to implement
Since
Frontier
Group
Stack, Memory, Storage and Flow Operations
Description
0x58 - PC
Notes
The program counter (PC) is a byte offset in the deployed code. It indicates which instruction will be executed next. When an ADD is executed, for example, the PC is incremented by 1, since the instruction is 1 byte. The PUSH instructions are bigger than one byte, and so will increment the counter accordingly.
Stack output
counter: PC of this instruction in the current program.
Example
See in playground.
Error cases
The state changes done by the current context are reverted in those cases:
Not enough gas.
Stack overflow.
The text was updated successfully, but these errors were encountered: