![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_MAX opcode for finding the maximum 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_MAX |
| Value | a = pop_value(vm) |
| break | |
Implements the OP_MAX opcode for finding the maximum of two values in the VM.
This file handles the OP_MAX instruction, which finds the maximum of two integer values. The values are popped from the stack, and the result is pushed back.
Behavior:
Error Handling:
Example: // Bytecode: OP_MAX // Stack before: [10, 42] // Stack after: [42]
Definition in file max.c.
| free_value | ( | a | ) |
| free_value | ( | b | ) |
| push_value | ( | vm | , |
| make_int(a.i > b.i ? a.i :b.i) | ) |