Class: Fisk::UnresolvedRIPInstruction
- Inherits:
-
Object
- Object
- Fisk::UnresolvedRIPInstruction
- Includes:
- InstructionPredicates
- Defined in:
- lib/fisk.rb
Instance Method Summary collapse
- #encode(buffer, labels) ⇒ Object
-
#initialize(insn, form, operands) ⇒ UnresolvedRIPInstruction
constructor
A new instance of UnresolvedRIPInstruction.
- #retry? ⇒ Boolean
Methods included from InstructionPredicates
#comment?, #has_temp_registers?, #jump?, #label?, #lazy?
Constructor Details
#initialize(insn, form, operands) ⇒ UnresolvedRIPInstruction
Returns a new instance of UnresolvedRIPInstruction.
402 403 404 405 406 407 408 |
# File 'lib/fisk.rb', line 402 def initialize insn, form, operands @insn = insn @form = form @operands = operands @retry = false @saved_pos = 0 end |
Instance Method Details
#encode(buffer, labels) ⇒ Object
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/fisk.rb', line 412 def encode buffer, labels # Use dummy values for any unresolvable operands operands = @operands.map do |op| if op.rip? && op.unresolved? # Try resolving the operands if labels.key?(op.displacement.name) Registers::Rip.new labels[op.displacement.name] - @saved_pos else Registers::Rip.new 0x0CAFE end else op end end @form.encodings.first.encode buffer, operands @saved_pos = buffer.pos end |
#retry? ⇒ Boolean
410 |
# File 'lib/fisk.rb', line 410 def retry?; true; end |