.. _setup_done:
	
		Finish the setup of the Processor.

		This should be the last call before the Processor is used.
		Sets the `internal constants`_ (used by the assembler) and
		sets the Stack Pointer to RAMEND_HIGH, if there is a RAM attached.
		If there is no RAM attached, SP will stay ``0``.

		If there is a RAM attached ``push_pc`` is set.

		Might raise SetupError_.

def setup_done(self):
		"""
		.. _setup_done:
	
		Finish the setup of the Processor.

		This should be the last call before the Processor is used.
		Sets the `internal constants`_ (used by the assembler) and
		sets the Stack Pointer to RAMEND_HIGH, if there is a RAM attached.
		If there is no RAM attached, SP will stay ``0``.

		If there is a RAM attached ``push_pc`` is set.

		Might raise SetupError_.
		"""
		if(self.memory_bus.device_count() < 1):
			raise SetupError("At least a ROM device has to be attached.")

		rom = self.memory_bus.devices[0]
		self.constants["ROMEND_HIGH"] = rom.size - 1
		self.constants["ROMEND_LOW"] = 0

		if(self.memory_bus.device_count() > 1):
			ram = self.memory_bus.devices[1]
			self.constants["RAMEND_HIGH"] = rom.size + ram.size - 1
			self.constants["RAMEND_LOW"] = rom.size
			self._set_sp(rom.size + ram.size - 1)
			self.push_pc = True
		if(self.device_bus.device_count() > 0):
			flash = self.device_bus.devices[0]
			self.constants["FLASH_START"] = 0
			self.constants["FLASH_END"] = flash.size - 1