remian 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/bin/remian +8 -0
- data/lib/remian.rb +2 -1
- data/lib/remian/control.rb +3 -1
- data/lib/remian/decoder.rb +3 -1
- data/lib/remian/version.rb +3 -0
- data/remian.gemspec +22 -0
- metadata +3 -1
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/bin/remian
CHANGED
@@ -5,6 +5,14 @@ require "remian"
|
|
5
5
|
|
6
6
|
module Remian
|
7
7
|
class Thorian < Thor
|
8
|
+
map "-v" => :version
|
9
|
+
|
10
|
+
desc "version", "Get Remian version."
|
11
|
+
|
12
|
+
def version
|
13
|
+
puts "v#{Remian::VERSION}"
|
14
|
+
end
|
15
|
+
|
8
16
|
desc "execute FILEPATH", "Runs given .rem file."
|
9
17
|
|
10
18
|
method_option :clock_speed, default: 30, aliases: "-c", desc: "Machine clock speed in Hz (default 50)."
|
data/lib/remian.rb
CHANGED
data/lib/remian/control.rb
CHANGED
@@ -48,9 +48,11 @@ module Remian
|
|
48
48
|
@registers[:address] = @registers[:address] + 1
|
49
49
|
|
50
50
|
instruction = @decoder.parse address_contents
|
51
|
+
return if instruction[:skip]
|
52
|
+
|
51
53
|
if not instruction[:opcode].nil? and @instruction_set.respond_to? instruction[:opcode]
|
52
54
|
Remian.say "> #{address_contents}", :green
|
53
|
-
@instruction_set.send(instruction[:opcode], instruction[:
|
55
|
+
@instruction_set.send(instruction[:opcode], instruction[:operands])
|
54
56
|
else
|
55
57
|
Remian.say "Instruction '#{instruction[:opcode]}' is not defined.", :red
|
56
58
|
end
|
data/lib/remian/decoder.rb
CHANGED
data/remian.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "remian/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "remian"
|
8
|
+
gem.version = Remian::VERSION
|
9
|
+
gem.authors = ["Michael Mokrysz"]
|
10
|
+
gem.email = ["hi@46bit.com"]
|
11
|
+
gem.description = "A baby virtual machine built in Ruby."
|
12
|
+
gem.summary = "Remian is a small virtual machine, designed to a Von Neumann architecture with a RISC mindset."
|
13
|
+
gem.homepage = "https://github.com/46Bit/remian"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = ["remian"]
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency "thor", "~> 0.16.0"
|
21
|
+
gem.add_dependency "term-ansicolor", "~> 1.0.7"
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -81,6 +81,8 @@ files:
|
|
81
81
|
- lib/remian/instruction_set/set.rb
|
82
82
|
- lib/remian/instruction_set/zero.rb
|
83
83
|
- lib/remian/memory.rb
|
84
|
+
- lib/remian/version.rb
|
85
|
+
- remian.gemspec
|
84
86
|
homepage: https://github.com/46Bit/remian
|
85
87
|
licenses: []
|
86
88
|
post_install_message:
|