Class: YTLJit::OpIndirect
Instance Attribute Summary collapse
-
#disp ⇒ Object
readonly
Returns the value of attribute disp.
-
#reg ⇒ Object
readonly
Returns the value of attribute reg.
Instance Method Summary collapse
-
#initialize(reg, disp = 0) ⇒ OpIndirect
constructor
A new instance of OpIndirect.
- #reg_no ⇒ Object
- #to_as ⇒ Object
- #using(reg) ⇒ Object
Constructor Details
#initialize(reg, disp = 0) ⇒ OpIndirect
Returns a new instance of OpIndirect.
123 124 125 126 127 128 129 |
# File 'lib/ytljit/instruction.rb', line 123 def initialize(reg, disp = 0) @reg = reg if disp.is_a?(Fixnum) then disp = OpImmidiate.new(disp) end @disp = disp end |
Instance Attribute Details
#disp ⇒ Object (readonly)
Returns the value of attribute disp.
132 133 134 |
# File 'lib/ytljit/instruction.rb', line 132 def disp @disp end |
#reg ⇒ Object (readonly)
Returns the value of attribute reg.
131 132 133 |
# File 'lib/ytljit/instruction.rb', line 131 def reg @reg end |
Instance Method Details
#reg_no ⇒ Object
147 148 149 |
# File 'lib/ytljit/instruction.rb', line 147 def reg_no @reg.reg_no end |
#to_as ⇒ Object
135 136 137 138 139 140 141 |
# File 'lib/ytljit/instruction.rb', line 135 def to_as if @disp.is_a?(OpImmidiate) then "#{@disp.value}(#{@reg.to_as})" else "#{@disp.value}(#{@reg.to_as})" end end |
#using(reg) ⇒ Object
143 144 145 |
# File 'lib/ytljit/instruction.rb', line 143 def using(reg) @reg == reg end |