GNU ELPA - lmc

lmc

Description
Little Man Computer in Elisp
Latest
lmc-1.4.tar (.sig), 2024-Mar-31, 40.0 KiB
Maintainer
Stefan Monnier <monnier@iro.umontreal.ca>
Atom feed
lmc.xml
Website
https://elpa.gnu.org/packages/lmc.html
Browse repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

A simulator for the Little Man Computer.
http://en.wikipedia.org/wiki/Little_man_computer

The simulator uses a plain editable buffer, so you can edit the machine
words just like any other text, and every word can be given a name (label)
which can also be edited in the normal way.  Additionally to the labels it
shows the disassembled meaning of instruction words.  Of course, it can't
always know which words are meant to be code rather than data, so it relies
on information from the assembler to do that, and otherwise just marks every
word it executes as being "code".

The assembly uses a slightly different (Lispish) syntax where comments start
with ";", and each instruction needs to be wrapped in parentheses.
Other than that it's the same assembly as documented elsewhere
(accepts a few mnemonic variants, such as IN/INP, STA/STO, BR/BRA).
Another difference is that the DAT mnemonic accepts any number of words
rather than just one.

So the assembly (stored in files with extension ".elmc") looks like:

  label1
         (BR label2) ;Useless extra jump.
  label2
         (LDA data1) ;Cleverest part of the algorithm.
         (ADD data2)
         (STO data1)
         (BR label1)
         
  data1  (DAT 0)
  data2  (DAT 050 060 070)

And actually, since the assembler re-uses the Emacs Lisp reader to parse the
code, you can use binary, octal, and hexadecimal constants as well, using
the notations #b101010, #o277, and #x5F respectively.

The lmc-asm-mode supports the usual editing features such as label
completion, mnemonic completion, jumping to a label, automatic indentation,
and code folding.

Old versions

lmc-1.3.el.lz2014-Jan-288.31 KiB
lmc-1.2.el.lz2013-Apr-238.26 KiB
lmc-1.1.el.lz2013-Mar-218.06 KiB
lmc-1.0.el.lz2012-Nov-297.97 KiB