jump was written off the end of binary code, fixed

This commit is contained in:
Torsten Ruger
2018-05-28 11:45:04 +03:00
parent 1c09d4202f
commit be1bc63ff2
10 changed files with 58 additions and 27 deletions

View File

@ -33,8 +33,8 @@ module Risc
end
end
def reset_to(pos , ignored)
super(pos, ignored)
init(pos , ignored)
super(pos, ignored)
Position.log.debug "ResetCode (#{pos.to_s(16)}) #{code}"
end
# insert a jump to the next instruction, at the last instruction

View File

@ -24,7 +24,7 @@ module Risc
end
def init(at, binary)
return if at == 0 and binary.nil?
raise "faux pas" if Position.get(instruction).at < Position.get(binary).at
raise "faux pas" if at < Position.get(binary).at
return unless @instruction.next
@binary = binary
nekst = at + @instruction.byte_length
@ -43,8 +43,8 @@ module Risc
end
def reset_to(pos , binary)
super(pos , binary)
init(pos , binary)
super(pos , binary)
Position.log.debug "ResetInstruction (#{pos.to_s(16)}) #{instruction}"
end
end