Module: Remian

Defined in:
lib/remian/memory.rb,
lib/remian.rb,
lib/remian/clock.rb,
lib/remian/control.rb,
lib/remian/version.rb,
lib/remian/instruction_set.rb,
lib/remian/instruction_set/cp.rb,
lib/remian/instruction_set/mv.rb,
lib/remian/instruction_set/or.rb,
lib/remian/instruction_set/and.rb,
lib/remian/instruction_set/not.rb,
lib/remian/instruction_set/put.rb,
lib/remian/instruction_set/set.rb,
lib/remian/instruction_set/exit.rb,
lib/remian/instruction_set/jump.rb,
lib/remian/instruction_set/zero.rb,
lib/remian/instruction_set/add_i.rb,
lib/remian/instruction_set/put_a.rb,
lib/remian/instruction_set/branch.rb

Overview

Addresses start at 1, despite underlying 0-based array implementation This makes assembly programming easier, since line numbers correspond to addresses.

Defined Under Namespace

Classes: Clock, Control, InstructionSet, Memory

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.say(message, colour_hash) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/remian.rb', line 6

def self.say message, colour_hash
  unless colour_hash.nil? || !Term::ANSIColor.respond_to?(colour_hash)
    extend Term::ANSIColor
    message = Term::ANSIColor.method(colour_hash.to_s).call(message)
  end
  puts message
end