1sand0s / Lc3B-Assembler

C implementation of an assembler for the LC3b ISA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lc3B-Assembler

GitHub Workflow Status GitHub GitHub

A standalone assembler for the Lc3B ISA written from scratch in C without any external libraries besides std Clibs.
The computer can only process 1's and 0's or machine code and therefore any program instructing the computer to perform a certain task must be in machine code. However, writing programs in machine code is extremely difficult. This difficulty is overcome by introducing higher level programming languages which abstract away the complexity of coding directly in machine code. Assembly language is one such higher(relative to machine code) level of abstraction. However, since the computer can only understand machine code, programs written in these higher level languages must be transformed into machine code. An assembler is a tool that transforms programs written in the assembly language to machine code.

Requirements

  1. GCC C Compiler
  2. GNU Make
  3. Check

Building

  1. Clone the Lc3B-Assembler repository:

    If you installed Git, execute the following command:
    git clone https://github.com/1sand0s/Lc3B-Assembler.git

    Otherwise, download the repository as a zip ball

  2. Building and Running Tests:

    cd to the project root directory Lc3B-Assembler, and execute

    ./configure LIBS=-lm
    make 
    make check
    sudo make install
    

    The configure script might complain about check package not being present. check is the test runner used for unit-testing. You can install check as follows sudo apt-get install check or build it from source by following these instructions

Usage

To use the assembler, cd to the directory Lc3B-Assembler/src and execute:
./Lc3BAssembler <*.asm> <*.hex>

About

C implementation of an assembler for the LC3b ISA

License:MIT License


Languages

Language:Shell 54.9%Language:C 24.7%Language:Makefile 19.6%Language:Assembly 0.4%Language:CMake 0.3%Language:M4 0.1%