1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-07-22 19:29:33 +00:00

Added help and argument checking for assemble.

This commit is contained in:
Mike Naberezny 2008-11-21 18:21:25 +00:00
parent 660b4346f5
commit 996694c4bd

View File

@ -110,7 +110,11 @@ class Monitor(cmd.Cmd):
return self.help_EOF()
def do_assemble(self, args):
start, statement = args.split(None, 1)
split = args.split(None, 1)
if len(split) != 2:
return self.help_assemble()
start, statement = split
start = self._address_parser.number(start)
bytes = self._assembler.assemble(statement)
@ -121,6 +125,10 @@ class Monitor(cmd.Cmd):
self._mpu.memory[start:end] = bytes
self.do_disassemble('%04x:%04x' % (start, end))
def help_assemble(self):
self._output("assemble <address> <statement>")
self._output("Assemble a statement at the address.")
def do_disassemble(self, args):
start, end = self._address_parser.range(args)
if start == end: