Class: Tataru::Instructions::InitInstruction

Inherits:
Tataru::Instruction show all
Defined in:
lib/tataru/instructions/init_instruction.rb

Overview

instruction to initialize the memory

Instance Attribute Summary collapse

Attributes inherited from Tataru::Instruction

#memory

Instance Method Summary collapse

Methods inherited from Tataru::Instruction

#execute, expects

Constructor Details

#initializeInitInstruction

Returns a new instance of InitInstruction.



9
10
11
12
13
14
15
# File 'lib/tataru/instructions/init_instruction.rb', line 9

def initialize
  @remote_ids = {}
  @outputs = {}
  @rom = {}
  @labels = {}
  @deleted = []
end

Instance Attribute Details

#deletedObject

Returns the value of attribute deleted.



7
8
9
# File 'lib/tataru/instructions/init_instruction.rb', line 7

def deleted
  @deleted
end

#labelsObject

Returns the value of attribute labels.



7
8
9
# File 'lib/tataru/instructions/init_instruction.rb', line 7

def labels
  @labels
end

#outputsObject

Returns the value of attribute outputs.



7
8
9
# File 'lib/tataru/instructions/init_instruction.rb', line 7

def outputs
  @outputs
end

#remote_idsObject

Returns the value of attribute remote_ids.



7
8
9
# File 'lib/tataru/instructions/init_instruction.rb', line 7

def remote_ids
  @remote_ids
end

#romObject

Returns the value of attribute rom.



7
8
9
# File 'lib/tataru/instructions/init_instruction.rb', line 7

def rom
  @rom
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
# File 'lib/tataru/instructions/init_instruction.rb', line 17

def run
  memory.hash[:remote_ids] = @remote_ids
  memory.hash[:outputs] = @outputs
  memory.hash[:labels] = @labels
  memory.hash[:rom] = @rom.freeze
  memory.hash[:deleted] = @deleted
  memory.hash[:update_action] = {}
end