Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
jump.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2025 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
10/**
11 * @file jump.c
12 * @brief Implements the OP_JUMP opcode for unconditional jumps in the VM.
13 *
14 * This file handles the OP_JUMP instruction, which performs an unconditional
15 * jump to a new instruction pointer location.
16 *
17 * Behavior:
18 * - Sets IP to operand value
19 * - No stack manipulation
20 *
21 * Used for:
22 * - Loops
23 * - Function returns
24 * - Conditional control flow
25 */
26
27case OP_JUMP: {
28 f->ip = inst.operand;
29 break;
30}
@ OP_JUMP
Definition bytecode.h:57
FILE * f
Definition read_file.c:38