1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-09-16 00:59:06 +00:00

Improve error messages for "assemble" command.

This commit is contained in:
Mike Naberezny 2009-03-29 22:06:47 -07:00
parent d43cda43b5
commit 1c3c70c459

View File

@ -137,11 +137,15 @@ class Monitor(cmd.Cmd):
return self.help_assemble()
start, statement = split
start = self._address_parser.number(start)
try:
start = self._address_parser.number(start)
except KeyError:
self._output("Bad label: %s" % start)
return
bytes = self._assembler.assemble(statement)
if bytes is None:
self._output("Statement could not be assembled.")
self._output("Assemble failed: %s" % statement)
else:
end = start + len(bytes)
self._mpu.memory[start:end] = bytes