automatically create binary once cpu instructions are there
This commit is contained in:
parent
3fcb4b74c7
commit
294f4d988f
@ -1,4 +1,6 @@
|
|||||||
module Arm
|
module Arm
|
||||||
|
# A translator is cpu specific and translates from risc instructions to a given
|
||||||
|
# cpu. This one transltes to Arm Instructions.
|
||||||
class Translator
|
class Translator
|
||||||
|
|
||||||
# translator should translate from register instructio set to it's own (arm eg)
|
# translator should translate from register instructio set to it's own (arm eg)
|
||||||
|
@ -57,12 +57,9 @@ module Parfait
|
|||||||
@cpu_instructions << cpu if cpu
|
@cpu_instructions << cpu if cpu
|
||||||
nekst = nekst.next
|
nekst = nekst.next
|
||||||
end
|
end
|
||||||
@cpu_instructions
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_binary
|
|
||||||
total = @cpu_instructions.total_byte_length / 4 + 1
|
total = @cpu_instructions.total_byte_length / 4 + 1
|
||||||
@binary = BinaryCode.new( total )
|
@binary = BinaryCode.new( total )
|
||||||
|
@cpu_instructions
|
||||||
end
|
end
|
||||||
|
|
||||||
# determine whether this method has an argument by the name
|
# determine whether this method has an argument by the name
|
||||||
|
@ -50,7 +50,6 @@ module Risc
|
|||||||
next unless method.is_a? Parfait::TypedMethod
|
next unless method.is_a? Parfait::TypedMethod
|
||||||
log.debug "CODE1 #{method.name}"
|
log.debug "CODE1 #{method.name}"
|
||||||
# create binary for assembly
|
# create binary for assembly
|
||||||
method.create_binary
|
|
||||||
binary = method.binary
|
binary = method.binary
|
||||||
Positioned.set_position(binary,at)
|
Positioned.set_position(binary,at)
|
||||||
method.cpu_instructions.set_position( at + 12) # BinaryCode header
|
method.cpu_instructions.set_position( at + 12) # BinaryCode header
|
||||||
|
Loading…
Reference in New Issue
Block a user