Class: Ragweed::Rasm::Call

Inherits:
Instruction show all
Defined in:
lib/ragweed/rasm/isa.rb

Overview

Call a register/memory location

Instance Attribute Summary

Attributes inherited from Instruction

#dst, #src

Instance Method Summary collapse

Methods inherited from Instruction

#add, #coerce, #dst_imm?, #dst_lab?, #dst_reg?, i, #locate, #modrm, #patch, #sib, #src_imm?, #src_lab?, #src_reg?

Constructor Details

#initialize(dst = nil) ⇒ Call

e8 rel ff/2 r/m no far yet



505
# File 'lib/ragweed/rasm/isa.rb', line 505

def initialize( dst=nil); super dst; end

Instance Method Details

#to_sObject

Raises:



507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/ragweed/rasm/isa.rb', line 507

def to_s
  raise Insuff if not @dst

  if dst_reg?
    add(0xff)
    add(modrm(@dst, Edx.clone))
  else
    add(0xe8)
    add(@dst.val, true)
  end
  super
end