Class: X86Assembler::X86Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/rmasm/x86/x86_assembler.rb

Constant Summary collapse

@@imm8_range =
0..256

Class Method Summary collapse

Class Method Details

.check(arg, type) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/rmasm/x86/x86_assembler.rb', line 33

def self.check(arg, type)
  case type
    when :imm8
      if ( ! (arg.is_a?(Integer) && @@imm8_range === arg.to_i) )
        RMasm::Report.error("Invalid number: (#{arg}). Expecting (#{type}). Not in range [#{@@imm8_range}]")
      end
  end
  return arg
end