reorder methods as they are called

This commit is contained in:
Torsten Ruger 2018-03-26 18:18:25 +03:00
parent a9d5e144ca
commit 46a5eefbd4

View File

@ -29,6 +29,21 @@ module Risc
position_code_from( at )
end
def position_objects( at )
at += 8 # thats the padding
# want to have the objects first in the executable
@objects.each do | id , objekt|
if objekt.is_a? Risc::Label # will get assembled as method.cpu_instructions
Positioned.set_position(objekt,at)
next
end
next if objekt.is_a? Parfait::BinaryCode
Positioned.set_position(objekt,at)
at += objekt.padded_length
end
at
end
def position_code_from( at )
@objects.each do |id , objekt|
next unless objekt.is_a? Parfait::TypedMethod
@ -53,21 +68,6 @@ module Risc
at
end
def position_objects( at )
at += 8 # thats the padding
# want to have the objects first in the executable
@objects.each do | id , objekt|
if objekt.is_a? Risc::Label # will get assembled as method.cpu_instructions
Positioned.set_position(objekt,at)
next
end
next if objekt.is_a? Parfait::BinaryCode
Positioned.set_position(objekt,at)
at += objekt.padded_length
end
at
end
# objects must be written in same order as positioned / assembled
def write_as_string
assemble