Class: Fisk::Instruction
Instance Method Summary
collapse
#comment?, #jump?, #label?, #lazy?, #retry?
Constructor Details
#initialize(insn, form, operands) ⇒ Instruction
Returns a new instance of Instruction.
349
350
351
352
353
|
# File 'lib/fisk.rb', line 349
def initialize insn, form, operands
@insn = insn
@form = form
@operands = operands
end
|
Instance Method Details
#encode(buffer, labels) ⇒ Object
367
368
369
370
|
# File 'lib/fisk.rb', line 367
def encode buffer, labels
encoding = @form.encodings.first
encoding.encode buffer, @operands
end
|
#encodings ⇒ Object
363
364
365
|
# File 'lib/fisk.rb', line 363
def encodings
@form.encodings
end
|
#has_temp_registers? ⇒ Boolean
355
356
357
|
# File 'lib/fisk.rb', line 355
def has_temp_registers?
@operands.any?(&:temp_register?)
end
|
#temp_registers ⇒ Object
359
360
361
|
# File 'lib/fisk.rb', line 359
def temp_registers
@operands.find_all(&:temp_register?)
end
|