give interpreter a clock and pc

where the pc, like in cpu’s is the memory position.
That is what the interpreter works on.
But for humans, the clock is a simpler way to count where the program
is at, no. of instructions executed
This commit is contained in:
Torsten Ruger
2018-05-23 18:05:22 +03:00
parent ef2dc932ad
commit a2e7d7c469
3 changed files with 34 additions and 15 deletions

View File

@@ -46,7 +46,7 @@ module Risc
end
def source_mini
return "(no source)" unless source
return "(from: #{source[0..35]})" if source.is_a?(String)
return "(from: #{source[0..50]})" if source.is_a?(String)
"(from: #{source.class.name.split("::").last})"
end
end