![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_MIN opcode for finding the minimum of two values in the VM. More...
Go to the source code of this file.
Functions | |
| if (a.type !=VAL_INT||b.type !=VAL_INT) | |
| push_value (vm, make_int(a.i< b.i ? a.i :b.i)) | |
| free_value (a) | |
| free_value (b) | |
Variables | |
| case | OP_MIN |
| Value | a = pop_value(vm) |
| break | |
Implements the OP_MIN opcode for finding the minimum of two values in the VM.
This file handles the OP_MIN instruction, which finds the minimum of two integer values. The values are popped from the stack, and the result is pushed back.
Behavior:
Error Handling:
Example: // Bytecode: OP_MIN // Stack before: [10, 42] // Stack after: [10]
Definition in file min.c.
| free_value | ( | a | ) |
| free_value | ( | b | ) |
| push_value | ( | vm | , |
| make_int(a.i< b.i ? a.i :b.i) | ) |