Skip to content

Comparison Opcodes ​

This section documents the comparison instructions available in CandleVM.

For operand encodings, see the executable format reference.

Comparisons ​

Opcode byteOpcodeOperand bytesBehavior
25Eqdestination: register, left: register, right: registerStores Value equality. Null, Bool, and Char values compare within their type. Byte and Number values compare numerically, including mixed pairs. ObjectRef values compare heap IDs, not object contents. ModuleRef and FunctionRef values always compare false.
26Nedestination: register, left: register, right: registerLogical inverse of Eq.
27ObjectEqdestination: register, left: register, right: registerRequires two valid ObjectRef values and compares the referenced heap objects by their object equality. Array, Map, String, Error and Buffer objects use their type-specific equality; nested ObjectRef values inside arrays/maps compare by heap ID through Value equality. Native objects use the equality behavior provided by the host runtime.
28ObjectNedestination: register, left: register, right: registerLogical inverse of ObjectEq.
29Ltdestination: register, left: register, right: registerStores Value partial less-than. Ordering is defined for numeric pairs (Byte and/or Number), two Bool values, or two Null values; unsupported pairs yield false.
30Ltedestination: register, left: register, right: registerStores partial less-than-or-equal. Incomparable pairs yield false.
31Gtdestination: register, left: register, right: registerStores partial greater-than. Incomparable pairs yield false.
32Gtedestination: register, left: register, right: registerStores partial greater-than-or-equal. Incomparable pairs yield false.

Built for the Candle ecosystem · Powered by VitePress.