split create_binary into two phases
Which gives instructions a chance to check everything and in Arms case check the constant loads/ instruction adding So that during assembly no more change happens (and we don't have to reassemble)
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
require "util/list"
|
||||
require "util/dev_null"
|
||||
|
||||
module Arm
|
||||
# Arm instruction base class
|
||||
# Mostly linked list functionality that all instructions have
|
||||
@ -21,6 +23,13 @@ module Arm
|
||||
ret
|
||||
end
|
||||
|
||||
# precheck that everything is ok, before asembly
|
||||
# in arm, we use the oppertunity to assemble to dev_null, so any
|
||||
# additions are done _before_ assemnly
|
||||
def precheck
|
||||
assemble(Util::DevNull.new)
|
||||
end
|
||||
|
||||
def insert(instruction)
|
||||
ret = super
|
||||
Risc::Position.get(self).trigger_inserted if Risc::Position.set?(self)
|
||||
|
Reference in New Issue
Block a user