diff --git a/lib/arm/translator.rb b/lib/arm/translator.rb index c2eca269..c9918f4a 100644 --- a/lib/arm/translator.rb +++ b/lib/arm/translator.rb @@ -1,4 +1,6 @@ module Arm + # A translator is cpu specific and translates from risc instructions to a given + # cpu. This one transltes to Arm Instructions. class Translator # translator should translate from register instructio set to it's own (arm eg) diff --git a/lib/parfait/typed_method.rb b/lib/parfait/typed_method.rb index 6baf164d..963d56f9 100644 --- a/lib/parfait/typed_method.rb +++ b/lib/parfait/typed_method.rb @@ -57,12 +57,9 @@ module Parfait @cpu_instructions << cpu if cpu nekst = nekst.next end - @cpu_instructions - end - - def create_binary total = @cpu_instructions.total_byte_length / 4 + 1 @binary = BinaryCode.new( total ) + @cpu_instructions end # determine whether this method has an argument by the name diff --git a/lib/risc/assembler.rb b/lib/risc/assembler.rb index 97571edd..d1ce0969 100644 --- a/lib/risc/assembler.rb +++ b/lib/risc/assembler.rb @@ -50,7 +50,6 @@ module Risc next unless method.is_a? Parfait::TypedMethod log.debug "CODE1 #{method.name}" # create binary for assembly - method.create_binary binary = method.binary Positioned.set_position(binary,at) method.cpu_instructions.set_position( at + 12) # BinaryCode header