fix dunamic jump in interpreter and misc
This commit is contained in:
parent
cab6bc389f
commit
e099014d63
@ -57,7 +57,7 @@ module Arm
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{opcode} [#{@first.join(',') }] #{super}"
|
||||
"#{opcode} [#{@first.join(', ') }] #{super}"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@ module Mom
|
||||
|
||||
def to_s
|
||||
names = [known_name] + @slots
|
||||
"[#{names.join(',')}]"
|
||||
"[#{names.join(', ')}]"
|
||||
end
|
||||
|
||||
def known_name
|
||||
|
@ -16,6 +16,7 @@ module Risc
|
||||
str = label.name
|
||||
when Parfait::BinaryCode
|
||||
str = "Code"
|
||||
str += ":#{Position.get(label)}" if Position.set?(label)
|
||||
else
|
||||
str = "(no label)"
|
||||
end
|
||||
|
@ -32,7 +32,8 @@ module Risc
|
||||
@linker = linker
|
||||
end
|
||||
|
||||
def start_program
|
||||
def start_program(linker = nil)
|
||||
@linker = linker || @linker
|
||||
initialize(@linker)
|
||||
init = @linker.cpu_init
|
||||
set_state(:running)
|
||||
@ -115,14 +116,15 @@ module Risc
|
||||
# Instruction interpretation starts here
|
||||
def execute_DynamicJump
|
||||
method = get_register(@instruction.register)
|
||||
set_pc( Position.get(method.cpu_instructions).at )
|
||||
pos = Position.get(method.binary).at + Parfait::BinaryCode.byte_offset
|
||||
set_pc( pos )
|
||||
false
|
||||
end
|
||||
def execute_Branch
|
||||
label = @instruction.label
|
||||
pos = Position.get(label).at
|
||||
pos += Parfait::BinaryCode.byte_offset if label.is_a?(Parfait::BinaryCode)
|
||||
set_pc pos
|
||||
set_pc( pos )
|
||||
false
|
||||
end
|
||||
|
||||
|
@ -52,7 +52,7 @@ module Vool
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{receiver}.#{name}(#{arguments.join(',')})"
|
||||
"#{receiver}.#{name}(#{arguments.join(', ')})"
|
||||
end
|
||||
def each(&block)
|
||||
block.call(self)
|
||||
|
@ -33,7 +33,7 @@ module Vool
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{receiver}.#{name}(#{arguments.join(',')})"
|
||||
"#{receiver}.#{name}(#{arguments.join(', ')})"
|
||||
end
|
||||
def each(&block)
|
||||
block.call(self)
|
||||
|
Loading…
Reference in New Issue
Block a user