lmc
- Description
- Little Man Computer in Elisp
- Latest
- lmc-1.4.0.20230105.113402.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. https://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.4.0.20221221.80449.tar.lz | 2022-Dec-21 | 8.15 KiB |
lmc-1.4.0.20201129.42203.tar.lz | 2020-Dec-14 | 8.12 KiB |
lmc-1.4.0.20201129.42203.tar.lz | 2020-Dec-14 | 8.12 KiB |
lmc-1.4.0.20201128.232203.tar.lz | 2021-Oct-09 | 8.12 KiB |
News
Since v1.4: - Removed old backward compatibility code.