def to_register(compiler, source)
      if known_object.respond_to?(:ct_type)
        type = known_object.ct_type
      elsif(known_object.respond_to?(:get_type))
        type = known_object.get_type
      else
        type = :Object
      end
      right = compiler.use_reg( type )
      case known_object
      when Constant
        parfait = known_object.to_parfait(compiler)
        const = Risc.load_constant(source, parfait , right)
        compiler.add_code const
        raise "Can't have slots into Constants" if slots.length > 0
      when Parfait::Object , Risc::Label
        const = const  = Risc.load_constant(source, known_object , right)
        compiler.add_code const
        if slots.length > 0
          # desctructively replace the existing value to be loaded if more slots
          compiler.add_code Risc.slot_to_reg( source , right ,slots[0], right)
        end
      when Symbol
        return sym_to_risc(compiler , source)
      else
        raise "We have a #{self} #{known_object}"
      end
      if slots.length > 1
        # desctructively replace the existing value to be loaded if more slots
        index = Risc.resolve_to_index(slots[0] , slots[1] ,compiler)
        compiler.add_code Risc::SlotToReg.new( source , right ,index, right)
        if slots.length > 2
          raise "3 slots only for type #{slots}" unless slots[2] == :type
          compiler.add_code Risc::SlotToReg.new( source , right , Parfait::TYPE_INDEX, right)
        end
      end
      return const.register
    end
def to_register(compiler, source)
      if known_object.respond_to?(:ct_type)
        type = known_object.ct_type
      elsif(known_object.respond_to?(:get_type))
        type = known_object.get_type
      else
        type = :Object
      end
      right = compiler.use_reg( type )
      case known_object
      when Constant
        parfait = known_object.to_parfait(compiler)
        const = Risc.load_constant(source, parfait , right)
        compiler.add_code const
        raise "Can't have slots into Constants" if slots.length > 0
      when Parfait::Object , Risc::Label
        const = const  = Risc.load_constant(source, known_object , right)
        compiler.add_code const
        if slots.length > 0
          # desctructively replace the existing value to be loaded if more slots
          compiler.add_code Risc.slot_to_reg( source , right ,slots[0], right)
        end
      when Symbol
        return sym_to_risc(compiler , source)
      else
        raise "We have a #{self} #{known_object}"
      end
      if slots.length > 1
        # desctructively replace the existing value to be loaded if more slots
        index = Risc.resolve_to_index(slots[0] , slots[1] ,compiler)
        compiler.add_code Risc::SlotToReg.new( source , right ,index, right)
        if slots.length > 2
          raise "3 slots only for type #{slots}" unless slots[2] == :type
          compiler.add_code Risc::SlotToReg.new( source , right , Parfait::TYPE_INDEX, right)
        end
      end
      return const.register
    end
load the slots into a register
 the code is added to compiler
 the register returned