Class: Ragweed::Rasm::Lea
- Inherits:
-
Instruction
- Object
- Instruction
- Ragweed::Rasm::Lea
- 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
Instance Method Summary collapse
-
#initialize(dst = nil, src = nil) ⇒ Lea
constructor
8d r, m.
- #to_s ⇒ Object
Methods inherited from Instruction
#add, #coerce, #decode, #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
900 |
# File 'lib/ragweed/rasm/isa.rb', line 900 def initialize( dst=nil, src=nil); super dst, src; end |
Instance Method Details
#to_s ⇒ Object
902 903 904 905 906 907 908 909 910 911 |
# File 'lib/ragweed/rasm/isa.rb', line 902 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 |