Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Comparison

Results are \(1_{i64}\) (true) or \(0_{i64}\) (false). All comparisons are signed.

CodeMnemonicStack EffectDescription
0x30EQ\([\ldots, a, b] \to [\ldots, [a = b]]\)Signed equality.
0x31LT\([\ldots, a, b] \to [\ldots, [a < b]]\)Signed less-than.
0x32GT\([\ldots, a, b] \to [\ldots, [a > b]]\)Signed greater-than.
0x33LTE\([\ldots, a, b] \to [\ldots, [a \le b]]\)Signed less-or-equal.
0x34GTE\([\ldots, a, b] \to [\ldots, [a \ge b]]\)Signed greater-or-equal.

None of these instructions have register effects.

The Iverson bracket notation \([P]\) equals \(1\) if \(P\) is true, \(0\) otherwise.

Boolean Convention

XQVM uses the integer convention for booleans: \(0\) is false, any non-zero value is true. Comparison instructions always produce exactly \(1\) or \(0\), making them directly usable as JUMPI conditions or logical operands.