Skip to content

mvparker810/gate_computer_compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LSASM - Logic Simulator Assembler

An assembler for a custom 8-bit instruction set architecture. Compiles assembly-style code into machine code.

Built for the custom computer from Digital Logic Sim by Sebastian Lague.

More info at mvparker.dev

Building

gcc lsasm.c -o lsasm

Usage

./lsasm [-f FORMAT] <input_file> <output_file>

Options

  • -f <FORMAT> - Output format: hex, uint, int, binary (default: hex)

Examples

./lsasm scripts/fib.txt machine_code.out
./lsasm -f binary scripts/fib.txt machine_code.out
./lsasm -f uint input.txt output.txt

Instruction Set

ALU Operations: AND, OR, XOR, NOT, ADD, SUB, LSL, LSR

Memory: READ, WRITE (constant/register addressing)

Control Flow: B, BEQ, BNE, BLT, BLE, BGT, BGE, BCS, BCC, BMI, BPL, BVS, BVC, BHI, BLS

Other: MOV, CMP, EXIT

About

A C-based assembler that compiles custom assembly language into machine code for my custom 8-bit CPU.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors