On 2013-08-01, Grant Edwards <invalid@invalid.invalid> wrote: > On 2013-08-01, Joshua Landau <jos...@landau.ws> wrote: >> On 31 July 2013 17:32, Grant Edwards <invalid@invalid.invalid> wrote: >> >>> On 2013-07-31, Tim Chase <python.l...@tim.thechases.com> wrote: >>> > On 2013-07-31 07:16, Joshua Landau wrote: >>> >> On 30 July 2013 18:52, Grant Edwards wrote: >>> >>> I also find intializers for tables of data to be much more easily >>> >>> read and maintained if the columns can be aligned. >>> >> >>> >> Why do you have tables in your Python code? >>> >>> For example: if you're writing an assembler, you usually have a table >>> of mnemonics/opcodes/instruction-format/addressing-modes. >> >> Why are you writing an assembler? > > I got tired of hand assembling (and disassembling) code for a custom > microprocessor, so I wrote an assembler and a disassembler.
FWIW, 250 lines of Python gets you a pretty decent 2-pass absolute assembler with full arithmetic expression support (including user-defined symbols). That 250 lines includes the "table" that defines the individual instructions. And yes, the columns in that table are aligned using spaces. ;) -- Grant Edwards grant.b.edwards Yow! I just had a NOSE at JOB!! gmail.com -- http://mail.python.org/mailman/listinfo/python-list