Class: Ragweed::Rasm::Lea

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

Overview

Load a memory address from a register into another register; uses memory notation, but is a pure arith insn

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, src = nil) ⇒ Lea

8d r, m



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

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

Instance Method Details

#to_sObject

Raises:



936
937
938
939
940
941
942
943
944
945
# File 'lib/ragweed/rasm/isa.rb', line 936

def to_s
  raise Insuff if not @src or not @dst
  raise(BadArg, "need reg src") if not src_reg?
  raise(BadArg, "need indirected src") if not @src.indir

  add(0x8d)
  add(modrm(@dst, @src))
  add(@src.disp)
  super
end