Skip to content
/ lmc Public

A simulation of the Little Man Computer (LMC) often used in a teaching environment.

License

Notifications You must be signed in to change notification settings

QcO-dev/lmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Little Man Computer

Simulates the Little Man Computer.

Offers assembly and emulation, with register and memory views.

Can take I/O.

Has both a run mode and a step-through mode.

May contain some bugs and inefficient code, as it was made for a challenge over a day or two.

Offers the standard instructions, as well as two non-standard instructions: OTC and LOA.

OTC

OTC (OutpuT Character) outputs the value currently in the accumlator as a character, based on its character code. E.g:

  • 65 -> A
  • 66 -> B
  • 97 -> a
  • 98 -> b
  • 33 -> !
  • etc

More on these codes here (ASCII). NOTE: All examples are available in ASCII, however any valid Unicode value which will fit into 3 decimal digits will also work.

LOA

LOA (Load Offset to Accumulator) takes an address/mailbox as its operand, offsets it by the value in the accumulator, then loads the value at the resulting address. LOA is the most complex instruction in the instruction set and exists to allow for immutable arrays (such as strings).

Example:

        LDA ONE
        LOA START
        OUT
        HLT

START   DAT 0
READ    DAT 404 // This is the memory that is loaded: START + 1

ONE     DAT 1   // Constant 1

This will output 404, as the address at START + ONE = READ, which contains the value 404.

About

A simulation of the Little Man Computer (LMC) often used in a teaching environment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published