glados-0.1.0.0
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

VM.Instruction.Logic

Description

 
Synopsis

Documentation

instEq :: VirtualMachine () Source #

Implements Equality Comparison (Opcode 0x20).

@details Pops two values and performs a deep equality check. Supports: Ints (loose), Bools, Lists (recursive), Structs, FuncPtrs.

instTEq :: VirtualMachine () Source #

Implements Typed Equality (Strict ===).

@details Checks if two values are identical in Type AND Value. No implicit casting (I8 5 !== I64 5). Standard Haskell == on VMValue does exactly this.

instLt :: VirtualMachine () Source #

Implements Less Than Comparison (Opcode 0x21).

@details Pops two values and checks if the second popped (Left) is less than the first (Right). Stack: [a, b] -> [a < b] (Push VBool)

instLe :: VirtualMachine () Source #

Implements Less or Equal Comparison (Opcode 0x25).

@details Pops two integers and checks if Left <= Right. Stack: [a, b] -> [a <= b]

instNot :: VirtualMachine () Source #

Implements Logical NOT (Opcode 0x22).

@details Pops a boolean and pushes its inverse. Stack: [a] -> [not a]

@throws Error if the popped value is not a VBool.

instAnd :: VirtualMachine () Source #

Implements Logical AND (Opcode 0x23).

@details Pops two booleans and pushes their conjunction. Stack: [a, b] -> [a && b]

instOr :: VirtualMachine () Source #

Implements Logical OR (Opcode 0x24).

@details Pops two booleans and pushes their disjunction. Stack: [a, b] -> [a || b]