Class: Lignite::Lt32

Inherits:
Object
  • Object
show all
Defined in:
lib/lignite/body_compiler.rb

Overview

Less-than (32 bit)

Instance Method Summary collapse

Constructor Details

#initialize(a, b) ⇒ Lt32

< Condition



4
5
6
7
# File 'lib/lignite/body_compiler.rb', line 4

def initialize(a, b)
  @a = a
  @b = b
end

Instance Method Details

#jump_back(compiler, body_size, self_size = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/lignite/body_compiler.rb', line 17

def jump_back(compiler, body_size, self_size = nil)
  if self_size.nil?
    fake = compiler.clone_context
    jump_back(fake, body_size, 0)
    self_size = fake.bytes.bytesize
  end

  compiler.jr_lt32(@a, @b, Complex(- (body_size + self_size), 2))
end

#jump_forward(compiler, body_size) ⇒ Object



13
14
15
# File 'lib/lignite/body_compiler.rb', line 13

def jump_forward(compiler, body_size)
  compiler.jr_lt32(@a, @b, Complex(body_size, 2))
end

#notObject



9
10
11
# File 'lib/lignite/body_compiler.rb', line 9

def not
  Ge32.new(@a, @b)
end