Class: Haxor::Compiler::Component::Various

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

Instance Attribute Summary

Attributes inherited from Base

#compiler

Instance Method Summary collapse

Methods inherited from Base

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

Instance Method Details

#cmd_int(a) ⇒ Object



22
23
24
25
# File 'lib/haxor/compiler/component/various.rb', line 22

def cmd_int(a)
  add Token::Cmd.new(Vm::Cpu::Unit::Various::OP_INT)
  parse_value a
end

#cmd_lea(a, b) ⇒ Object



16
17
18
19
20
# File 'lib/haxor/compiler/component/various.rb', line 16

def cmd_lea(a, b)
  add Token::Cmd.new(Vm::Cpu::Unit::Various::OP_LEA | offset_flags(a, b))
  parse_value a
  parse_value b
end

#cmd_nop(*_args) ⇒ Object



12
13
14
# File 'lib/haxor/compiler/component/various.rb', line 12

def cmd_nop(*_args)
  add Token::Cmd.new(Vm::Cpu::Unit::Various::OP_NOP)
end

#cmd_syscall ⇒ Object



27
28
29
# File 'lib/haxor/compiler/component/various.rb', line 27

def cmd_syscall
  add Token::Cmd.new(Vm::Cpu::Unit::Various::OP_SYSCALL)
end

#register ⇒ Object



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

def register
  bind_cmd 'nop', :cmd_nop
  bind_cmd 'lea', :cmd_lea
  bind_cmd 'int', :cmd_int
  bind_cmd 'syscall', :cmd_syscall
end