Class: Haxor::Compiler::Component::Logical

Inherits:
Base
  • Object
show all
Defined in:
lib/haxor/compiler/component/logical.rb

Instance Attribute Summary

Attributes inherited from Base

#compiler

Instance Method Summary collapse

Methods inherited from Base

#add, #add_cmd, #bind_cmd, #offset?, #offset_flags, #parse_value, #strip_offset

Instance Method Details

#cmd_and(a, b) ⇒ Object



13
14
15
# File 'lib/haxor/compiler/component/logical.rb', line 13

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

#cmd_neg(a) ⇒ Object



17
18
19
# File 'lib/haxor/compiler/component/logical.rb', line 17

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

#cmd_not(a) ⇒ Object



21
22
23
# File 'lib/haxor/compiler/component/logical.rb', line 21

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

#cmd_or(a, b) ⇒ Object



25
26
27
# File 'lib/haxor/compiler/component/logical.rb', line 25

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

#cmd_xor(a, b) ⇒ Object



29
30
31
# File 'lib/haxor/compiler/component/logical.rb', line 29

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

#register ⇒ Object



5
6
7
8
9
10
11
# File 'lib/haxor/compiler/component/logical.rb', line 5

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