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

Go to the source code of this file.
Functions | |
| if (idx< 0||idx >=MAX_GLOBALS) | |
| push_value (vm, copy_value(&vm->globals[idx])) | |
Variables | |
| case | OP_LOAD_GLOBAL |
| break | |
Implements the OP_LOAD_GLOBAL opcode for loading global variables in the VM.
This file handles the OP_LOAD_GLOBAL instruction, which loads a global variable onto the stack using its index.
Behavior:
Error Handling:
Example: // Bytecode: OP_LOAD_GLOBAL 0 // Stack before: [] // Stack after: [global_value]
Definition in file load_global.c.
| if | ( | idx< 0||idx > | = MAX_GLOBALS | ) |
Definition at line 32 of file load_global.c.
| push_value | ( | vm | , |
| copy_value &->[] | idx ) |
| break |
Definition at line 40 of file load_global.c.
| case OP_LOAD_GLOBAL |
Definition at line 30 of file load_global.c.