reorder methods as they are called
This commit is contained in:
parent
a9d5e144ca
commit
46a5eefbd4
@ -29,6 +29,21 @@ module Risc
|
|||||||
position_code_from( at )
|
position_code_from( at )
|
||||||
end
|
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 )
|
def position_code_from( at )
|
||||||
@objects.each do |id , objekt|
|
@objects.each do |id , objekt|
|
||||||
next unless objekt.is_a? Parfait::TypedMethod
|
next unless objekt.is_a? Parfait::TypedMethod
|
||||||
@ -53,21 +68,6 @@ module Risc
|
|||||||
at
|
at
|
||||||
end
|
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
|
# objects must be written in same order as positioned / assembled
|
||||||
def write_as_string
|
def write_as_string
|
||||||
assemble
|
assemble
|
||||||
|
Loading…
x
Reference in New Issue
Block a user