Class: Fisk::Instruction
- Inherits:
-
Object
- Object
- Fisk::Instruction
- Defined in:
- lib/fisk.rb
Instance Method Summary collapse
- #bytesize ⇒ Object
- #encode(buffer, labels) ⇒ Object
- #encodings ⇒ Object
-
#initialize(insn, form, operands) ⇒ Instruction
constructor
A new instance of Instruction.
- #label? ⇒ Boolean
Constructor Details
#initialize(insn, form, operands) ⇒ Instruction
Returns a new instance of Instruction.
157 158 159 160 161 |
# File 'lib/fisk.rb', line 157 def initialize insn, form, operands @insn = insn @form = form @operands = operands end |
Instance Method Details
#bytesize ⇒ Object
173 174 175 |
# File 'lib/fisk.rb', line 173 def bytesize @form.encodings.first.bytesize end |
#encode(buffer, labels) ⇒ Object
167 168 169 170 171 |
# File 'lib/fisk.rb', line 167 def encode buffer, labels encoding = @form.encodings.first encoding.encode buffer, @operands true end |
#encodings ⇒ Object
163 164 165 |
# File 'lib/fisk.rb', line 163 def encodings @form.encodings end |
#label? ⇒ Boolean
177 |
# File 'lib/fisk.rb', line 177 def label?; false; end |