.. _split_run:

		Splits the assembly code into

		* commands
		* directives
		* jump marks

def split_run(self):
		"""
		.. _split_run:

		Splits the assembly code into

		* commands
		* directives
		* jump marks

		"""
		sp_run = []
		for line in self.open_stream.read().split("\n"):
			self.line_count += 1
			if(self.iscomment(line)):
				continue
			if(line.isspace()):
				continue
			line = self.stripcomments(line)

			words = line.split()
			if(len(words) == 0):
				continue
			if(isreference(words)):
				self.add_ref(words)
				continue
			if(self.isdirective(words)):
				sp_run.append(self.handle_directive(words))
				continue
			if(not words[0] in self.commands):
				raise AssembleError("[Line {}]: Unknown Mnemonic '{}'".format(self.line_count, words[0]))

			mnemo = words[0]
			args = words[1:]
			if(len(args) != self.commands[mnemo].numargs()):
				# check for default arguments
				args_ = list(args)
				for argtype in self.commands[mnemo].argtypes()[len(args):]:
					if(not argtype.can_default):
						raise AssembleError("[Line {}]: Mnemonic '{}' expects {} arguments, but got {}".format(self.line_count, mnemo, self.commands[mnemo].numargs(), len(args)))
					else:
						args_.append(argtype.default)
				args = args_
			self.word_count += 1 + len(args)
						
			logging.debug("split run: " + str((self.line_count, "command", self.commands[mnemo], (args))))
			sp_run.append((self.line_count, "command", self.commands[mnemo], (args)))
		return sp_run