Skip to content

Assembler and Interpreter for the LittleManComputer Code in C

License

Notifications You must be signed in to change notification settings

bruneo32/LittleManComputer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LittleManComputer

Assembler and Interpreter for the LittleManComputer Code written in C

Installation

  • Windows:

    • Download lmc.zip
    • Extract it anywhere
    • Add the folder to the PATH (howto)
    • Open CMD and type lmc to verify installation
  • Linux:

     $ mkdir tarlmc
     $ tar xf lmc.tar.gz -C tarlmc
     $ cd tarlmc
    
    • Run ./setup.sh
     $ ./setup.sh
     Do you want to install  lmc (Interpreter)? [Y/n] y
     > cp lmc /usr/bin/lmc
    
     Do you want to install  lma (Assembler)? [Y/n] y
     > cp lma /usr/bin/lma
     
    
    • Type lmc to verify installation
     $ lmc
     No file specified.
    
     Usage:
             From File:   lmc file.txt
       Debug From File:   lmc +file.txt
             Immediate:   lmc :901308901309508209902000 
       Debug Immediate:   lmc +:901308901309508209902000
    
    

Build

  • Windows:
    • Run build.bat
    • Output: bin\lma.exe, bin\lmc.exe
    • Requirements: tcc for windows
  • Linux:
    • Run ./build.sh
    • Output: bin/lma, bin/lmc
    • Requirements: apt install tcc

Assembler

  • Comments
    • ; Line comment
    • / Line comment
  • Instructions
    • ADD
    • SUB
    • STA
    • LDA
    • BRA
    • BRZ
    • BRP
    • INP
    • OUT
    • HLT | COB
    • DAT

Using

example1 example2 example3 example4 example5

Wiki

wiki1 wiki2 wiki3 wiki4

Arrays? Where is opcode 4xx?

wiki4 wiki5

References: