/lc3-asm

LC-3 assembler written in pure python

Primary LanguageAssemblyThe UnlicenseUnlicense

LC-3 assembler in python

LC-3 assembler written in pure python

Getting Started

Assemble

python3 lc3.py [file]  # lc3 *.asm file
# Output *.obj file that can be run with simulator

Run tests:

python3 run-tests.py

Debug

To debug, you can use simple disassembler written by me:

python3 disasm.py [obj-file]

I found it very usefull trying to understand what went wrong (invalid address in symbol table, invalid LC count, invalid opcode encoding, etc.).

There is a lot of debug information printing out when assembling but it can be ignored or deleted.

Learning LC-3

You can find usefull information and Instruction Set Architecture (ISA) here and here

Also you may find usefull desctiptions in assembler.h file to better understand how to implement it here

Download

You can download simulator here

Or use my own implementation written in pure python

You can find 2048 game written in lc3 here