Class: RPicSim::ProgramCounter
- Inherits:
-
Object
- Object
- RPicSim::ProgramCounter
- Defined in:
- lib/rpicsim/program_counter.rb
Overview
Instances of this class represent the program counter in a simulated microcontroller.
Instance Method Summary collapse
-
#initialize(processor) ⇒ ProgramCounter
constructor
A new instance of ProgramCounter.
- #value ⇒ Integer
- #value=(val) ⇒ Object
Constructor Details
#initialize(processor) ⇒ ProgramCounter
Returns a new instance of ProgramCounter
8 9 10 |
# File 'lib/rpicsim/program_counter.rb', line 8 def initialize(processor) @processor = processor end |
Instance Method Details
#value ⇒ Integer
13 14 15 |
# File 'lib/rpicsim/program_counter.rb', line 13 def value @processor.get_pc end |
#value=(val) ⇒ Object
18 19 20 |
# File 'lib/rpicsim/program_counter.rb', line 18 def value=(val) @processor.set_pc(val) end |