Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
bnot.c File Reference

Implements the OP_BNOT opcode bitwise NOT (uint32). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 free_value (va)
 push_value (vm, make_int((int64_t)(uint64_t) r))

Variables

case OP_BNOT
uint32_t a = (va.type == VAL_INT) ? (uint32_t)va.i : 0u
uint32_t r = ~a
 break

Detailed Description

Implements the OP_BNOT opcode bitwise NOT (uint32).

Opcode snippet included by vm.c. Performs a 32-bit unsigned bitwise NOT on a single integer operand from the VM stack.

Stack effects:

  • pops: a
  • pushes: (uint32_t)(~a)

Notes:

  • Operand is interpreted as 32-bit unsigned when of type VAL_INT; non-integer values are treated as 0.
  • The result is pushed as VAL_INT with the 32-bit value preserved in the low bits.

Definition in file bnot.c.

Function Documentation

◆ free_value()

free_value(va)

◆ push_value()

push_value(vm,
make_int((int64_t)(uint64_t) r) )

Variable Documentation

◆ a

uint32_t a = (va.type == VAL_INT) ? (uint32_t)va.i : 0u

Definition at line 30 of file bnot.c.

◆ break

break

Definition at line 34 of file bnot.c.

◆ OP_BNOT

case OP_BNOT

Definition at line 28 of file bnot.c.

◆ r

uint32_t r = ~a

Definition at line 31 of file bnot.c.