Skip to content

joeysbase/LC3-Virtual-Machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Little Computer 3 (LC3) Virtual Machine

What is LC3

Little Computer 3, or LC-3, is a type of computer educational programming language, an assembly language, which is a type of low-level programming language. It features a relatively simple instruction set, but can be used to write moderately complex assembly programs, and is a viable target for a C compiler. ---Wikipedia

File Structure

/
|---LICENSE
|---hardware.c      # Implementation of all the instructions in LC3 and helper functions  
|---hardware.h      # Definition of LC3 hardware, instructions, and helper functions
|---lc3-vm.c        # Put everything together to build a running LC3 VM
|---README.md
|---.gitignore
/---Games
     |---2048.obj    # Binary file; each line is a machine code corresponding to an instruction
     |---rogue.obj         

Example Usage

Compile hardware.c and lc3-vm.c first to generate an excutable.

gcc -o "lc3" hardware.c lc3-vm.c

Then test with files in the Games folder.

./lc3 ./Games/rogue.obj
or
./lc3 ./Games/2048.obj

Reference

LC3-specification
Tutorial
Textbook resources

About

Now you know how computer works at a low level

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages