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, #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_s ⇒ Object
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 |