Sha256: 8b43b2b0da4e58a1296aded9fc71ba56ab0fe968f3c38812b7d5b5d36f6ff6f2

Contents?: true

Size: 770 Bytes

Versions: 1

Compression:

Stored size: 770 Bytes

Contents

module Haxor
  module Compiler
    module Component
      class Logical < Base
        def register
          bind_cmd 'and', :cmd_and
          bind_cmd 'neg', :cmd_neg
          bind_cmd 'not', :cmd_not
          bind_cmd 'or',  :cmd_or
          bind_cmd 'xor', :cmd_xor
        end

        def cmd_and(a, b)
          add_cmd Vm::Cpu::Unit::Logical::OP_AND, a, b
        end

        def cmd_neg(a)
          add_cmd Vm::Cpu::Unit::Logical::OP_NEG, a
        end

        def cmd_not(a)
          add_cmd Vm::Cpu::Unit::Logical::OP_NOT, a
        end

        def cmd_or(a, b)
          add_cmd Vm::Cpu::Unit::Logical::OP_OR, a, b
        end

        def cmd_xor(a, b)
          add_cmd Vm::Cpu::Unit::Logical::OP_XOR, a, b
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
haxor-0.3.0 lib/haxor/compiler/component/logical.rb