Class: GBRb::InstructionSet::Rst
- Inherits:
-
Instruction
- Object
- Instruction
- GBRb::InstructionSet::Rst
- Defined in:
- lib/gbrb/instruction_set/rst.rb
Instance Attribute Summary
Attributes inherited from Instruction
Instance Method Summary collapse
- #call(r, mem) ⇒ Object
-
#initialize(offset) ⇒ Rst
constructor
A new instance of Rst.
Methods inherited from Instruction
Constructor Details
#initialize(offset) ⇒ Rst
Returns a new instance of Rst.
5 6 7 8 |
# File 'lib/gbrb/instruction_set/rst.rb', line 5 def initialize offset @offset = offset super 1, 16 end |
Instance Method Details
#call(r, mem) ⇒ Object
10 11 12 13 14 |
# File 'lib/gbrb/instruction_set/rst.rb', line 10 def call r, mem r.sp.store r.sp.read - 2 mem.write_word r.sp.read, r.pc.read r.pc.store 0x0000 + @offset end |