Class: Rips::Formats::CFormat

Inherits:
Format
  • Object
show all
Defined in:
lib/rips/formats/cformat.rb

Instance Attribute Summary collapse

Attributes inherited from Format

#args_number, #opcode

Instance Method Summary collapse

Constructor Details

#initialize(opcode) ⇒ CFormat

@args: all instruction’s arguments



11
12
13
14
# File 'lib/rips/formats/cformat.rb', line 11

def initialize (opcode)
  super(opcode,2)
  @args = {}
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



8
9
10
# File 'lib/rips/formats/cformat.rb', line 8

def args
  @args
end

Instance Method Details

#set_arguments(args) ⇒ Object

Pass all arguments at once



17
18
19
# File 'lib/rips/formats/cformat.rb', line 17

def set_arguments (args)
  @args[:r1], @args[:r2] = args[1], args[0]
end