Class: Fisk::Instruction

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

Instance Method Summary collapse

Constructor Details

#initialize(insn, form, operands) ⇒ Instruction

Returns a new instance of Instruction.



157
158
159
160
161
# File 'lib/fisk.rb', line 157

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

Instance Method Details

#bytesizeObject



173
174
175
# File 'lib/fisk.rb', line 173

def bytesize
  @form.encodings.first.bytesize
end

#encode(buffer, labels) ⇒ Object



167
168
169
170
171
# File 'lib/fisk.rb', line 167

def encode buffer, labels
  encoding = @form.encodings.first
  encoding.encode buffer, @operands
  true
end

#encodingsObject



163
164
165
# File 'lib/fisk.rb', line 163

def encodings
  @form.encodings
end

#label?Boolean

Returns:

  • (Boolean)


177
# File 'lib/fisk.rb', line 177

def label?; false; end