![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_STORE_GLOBAL opcode for storing global variables in the VM. More...

Go to the source code of this file.
Functions | |
| if (idx< 0||idx >=MAX_GLOBALS) | |
| free_value (vm->globals[idx]) | |
Variables | |
| case | OP_STORE_GLOBAL |
| Value | v = pop_value(vm) |
| vm | globals [idx] = v |
| break | |
Implements the OP_STORE_GLOBAL opcode for storing global variables in the VM.
This file handles the OP_STORE_GLOBAL instruction, which stores a value into a global variable using its index.
Behavior:
Error Handling:
Example: // Bytecode: OP_STORE_GLOBAL 0 // Stack before: [42] // Stack after: []
Definition in file store_global.c.
| free_value | ( | vm-> | globals[idx] | ) |
| if | ( | idx< 0||idx > | = MAX_GLOBALS | ) |
Definition at line 32 of file store_global.c.
| break |
Definition at line 42 of file store_global.c.
Definition at line 41 of file store_global.c.
| case OP_STORE_GLOBAL |
Definition at line 30 of file store_global.c.
| Value v = pop_value(vm) |
Definition at line 36 of file store_global.c.