Class: Tataru::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/tataru/memory.rb

Overview

memory that can be manipulated by instructions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.



8
9
10
11
12
13
14
# File 'lib/tataru/memory.rb', line 8

def initialize
  @program_counter = 0
  @hash = { temp: {} }
  @error = nil
  @call_stack = []
  @end = false
end

Instance Attribute Details

#call_stackObject

Returns the value of attribute call_stack.



6
7
8
# File 'lib/tataru/memory.rb', line 6

def call_stack
  @call_stack
end

#endObject

Returns the value of attribute end.



6
7
8
# File 'lib/tataru/memory.rb', line 6

def end
  @end
end

#errorObject

Returns the value of attribute error.



6
7
8
# File 'lib/tataru/memory.rb', line 6

def error
  @error
end

#hashObject

Returns the value of attribute hash.



6
7
8
# File 'lib/tataru/memory.rb', line 6

def hash
  @hash
end

#program_counterObject

Returns the value of attribute program_counter.



6
7
8
# File 'lib/tataru/memory.rb', line 6

def program_counter
  @program_counter
end