no-ops really

This commit is contained in:
Torsten Ruger
2018-05-23 18:06:55 +03:00
parent a2e7d7c469
commit f5d1090c39
7 changed files with 23 additions and 18 deletions

View File

@ -14,6 +14,7 @@ module Risc
class Instruction
def nil_next
@next = nil
self
end
def byte_length
4
@ -30,12 +31,13 @@ module Risc
end
class IdentityTranslator
def translate(code)
#return Label.new( code.source , code.name ) if code.is_a?(Label)
if( code.is_a?(Branch))
return code.class.new(code.source , code.label.to_cpu(self))
case code
when Branch
ret = code.class.new(code.source , code.label.to_cpu(self))
else
ret = code.dup
ret.nil_next
end
ret = code.dup
ret.nil_next
ret
end
end

View File

@ -14,7 +14,7 @@ module Risc
class Machine
include Util::Logging
log_level :debug
log_level :info
def initialize
@booted = false

View File

@ -16,7 +16,7 @@ module Risc
module Position
include Util::Logging
log_level :debug
log_level :info
@positions = {}