Class: Fisk::Instruction
- Inherits:
-
Object
- Object
- Fisk::Instruction
- Defined in:
- lib/fisk.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
- #bytesize ⇒ Object
- #encode(buffer) ⇒ Object
- #encodings ⇒ Object
-
#initialize(insn, operands, position) ⇒ Instruction
constructor
A new instance of Instruction.
Constructor Details
#initialize(insn, operands, position) ⇒ Instruction
Returns a new instance of Instruction.
141 142 143 144 145 |
# File 'lib/fisk.rb', line 141 def initialize insn, operands, position @insn = insn @operands = operands @position = position end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
139 140 141 |
# File 'lib/fisk.rb', line 139 def position @position end |
Instance Method Details
#bytesize ⇒ Object
156 157 158 |
# File 'lib/fisk.rb', line 156 def bytesize @insn.encodings.first.bytesize end |
#encode(buffer) ⇒ Object
151 152 153 154 |
# File 'lib/fisk.rb', line 151 def encode buffer encoding = @insn.encodings.first encoding.encode buffer, @operands end |
#encodings ⇒ Object
147 148 149 |
# File 'lib/fisk.rb', line 147 def encodings @insn.encodings end |