last fixes for cc

seems like setup had just worked by chance and change broke that.
This commit is contained in:
2019-08-23 19:22:27 +03:00
parent 4ca16e5f9a
commit 1eb6430880
6 changed files with 17 additions and 7 deletions

View File

@ -28,6 +28,12 @@ module Mom
end
end
# Only for init, as init has no return
def _reset_for_init
@mom_instructions = Label.new(source_name, source_name)
@current = @mom_instructions
end
# add a constant (which get created during compilation and need to be linked)
def add_constant(const)
raise "Must be Parfait #{const}" unless const.is_a?(Parfait::Object)
@ -64,8 +70,8 @@ module Mom
while( instruction )
raise "whats this a #{instruction}" unless instruction.is_a?(Mom::Instruction)
#puts "adding mom #{instruction.to_s}:#{instruction.next.to_s}"
instruction.to_risc( risc_compiler )
risc_compiler.reset_regs
instruction.to_risc( risc_compiler )
#puts "adding risc #{risc.to_s}:#{risc.next.to_s}"
instruction = instruction.next
end