Class: Ragweed::Rasm::Shift
- Inherits:
-
Instruction
- Object
- Instruction
- Ragweed::Rasm::Shift
- Defined in:
- lib/ragweed/rasm/isa.rb
Overview
Wrapper for the shift operations below.
Instance Attribute Summary
Attributes inherited from Instruction
Instance Method Summary collapse
-
#initialize(dst = nil, src = nil) ⇒ Shift
constructor
A new instance of Shift.
- #magic(x, y, z, r) ⇒ Object
- #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) ⇒ Shift
Returns a new instance of Shift.
857 |
# File 'lib/ragweed/rasm/isa.rb', line 857 def initialize( dst=nil, src=nil); super dst, src; end |
Instance Method Details
#magic(x, y, z, r) ⇒ Object
879 |
# File 'lib/ragweed/rasm/isa.rb', line 879 def magic(x, y, z, r); @once, @bycl, @imm, @x = [x,y,z,r.clone]; end |
#to_s ⇒ Object
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
# File 'lib/ragweed/rasm/isa.rb', line 859 def to_s raise Insuff if not @dst raise(BadArg, "need reg dst") if not dst_reg? if not @src add(@once) add(modrm(@dst, @x)) else if src_imm? add(@imm) add(modrm(@dst, @x)) add(@src.val) else add(@bycl) add(modrm(@dst, @x)) end end super end |