fix an issue where instruction was in wrong code

embarrassingly used instance variable where it should have been local
This commit is contained in:
Torsten Ruger
2018-05-25 19:16:13 +03:00
parent 6f0fad0957
commit c0cd1e0740
5 changed files with 32 additions and 20 deletions

View File

@ -14,7 +14,7 @@ module Risc
# fire events for changed pc and register contents
include Util::Eventable
include Util::Logging
log_level :debug
log_level :info
attr_reader :instruction , :clock , :pc # current instruction and pc
attr_reader :registers # the registers, 16 (a hash, sym -> contents)
@ -119,7 +119,9 @@ module Risc
end
def execute_Branch
label = @instruction.label
set_pc Position.get(label).at
pos = Position.get(label).at
pos += Parfait::BinaryCode.offset if label.is_a?(Parfait::BinaryCode)
set_pc pos
false
end