Class: Noofakku::Dec
- Inherits:
-
Object
- Object
- Noofakku::Dec
- Defined in:
- lib/noofakku/instruction/dec.rb
Instance Method Summary collapse
Instance Method Details
#hook ⇒ Object
3 4 5 |
# File 'lib/noofakku/instruction/dec.rb', line 3 def hook '-' end |
#perform(processor, memory, program, input, output) ⇒ Object
7 8 9 10 11 |
# File 'lib/noofakku/instruction/dec.rb', line 7 def perform(processor, memory, program, input, output) raise "processor cannot be nil" unless processor != nil raise "memory cannot be nil" unless memory != nil memory[processor.data_pointer] -= 1 end |