Class: Fisk::Instruction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(insn, operands, position) ⇒ Instruction

Returns a new instance of Instruction.



141
142
143
144
145
# File 'lib/fisk.rb', line 141

def initialize insn, operands, position
  @insn     = insn
  @operands = operands
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



139
140
141
# File 'lib/fisk.rb', line 139

def position
  @position
end

Instance Method Details

#bytesizeObject



156
157
158
# File 'lib/fisk.rb', line 156

def bytesize
  @insn.encodings.first.bytesize
end

#encode(buffer) ⇒ Object



151
152
153
154
# File 'lib/fisk.rb', line 151

def encode buffer
  encoding = @insn.encodings.first
  encoding.encode buffer, @operands
end

#encodingsObject



147
148
149
# File 'lib/fisk.rb', line 147

def encodings
  @insn.encodings
end