Skip to main content

agbcc python frontend

Project description

agbpycc

Gitmoji

agbpycc is a python based compiler frontend for the agbcc compiler for the GameBoy Advance. It provides an interface more similar to a modern gcc frontend, making it easier to use agbcc with other tools like compiler explorer. agbpycc also does some processing of the assembly code, allowing for easier comparrison to other assembly. This is due to its main usage in decompiling matching binaries.

Installation

You can install agbpycc from pypi using pip. This installs agbpycc as a command line tool, and also as an importable module. You might want to use a virtual environment.

pip install agbpycc

To install from source, you need to build the ASM Parser first. This requires antlr. The provided Makefile takes care of downloading the tool using wget. Should wget not be available to you as a command, download the antlr tool manually, and place it in the projects directory.

git clone https://gitlab.com/henny022/agbpycc
cd agbpycc
make install

To work with the project files directly, you need to install the required dependencies in addition to building the antlr files. You can use the provided make target to do all this

git clone https://gitlab.com/henny022/agbpycc
cd agbpycc
make setup

Usage

To run agbpycc after install, use the agbpycc command line tool.

agbpycc <arguments>

To run the files from source without installing run the python module from the project directory.

python -m agbpycc <arguments>

The following is a list of the most basic arguments. Run agbpycc --help to get a full list.

    --cc1   Path to the agbcc binary (required for compiling C)
    -o      output assembly file name
    -g      enable debug info
            processed output contains only file and line information

Assembling objects and Linking binaries are not yet supported.

Examples

compile a file to cleaned assembly for nice human reading

agbpycc --cc1 agbcc -g -o output.s input.c

clean assembly for nice human reading

agbpycc -o output.s input.s

Support

For problems with the tool, please use the gitlab issue tracker. For questions you can use the tmc-misc channel on the zeldaret discord server. Ping @Henny022 there.

Contributing

To contribute your own code to this project, create a fork, do you changes and open a Merge Request. Please use gitmoji in your commit messages, this creates a neat git history and allows to grasp the contents of a commit in a single look.

Authors and acknowledgment

This was originally based on the pycc.py file in this repo, most of the has been modified or replaced since. (original file)

Main Contributors:

  • Octorock
  • Henny022

License

This is licensed under the Unlicense. So you can use this code however you want. Any credit you can give is very appreciated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agbpycc-0.2.0.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

agbpycc-0.2.0-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file agbpycc-0.2.0.tar.gz.

File metadata

  • Download URL: agbpycc-0.2.0.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for agbpycc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ddaada4f65d2458ce2c9e6fa9699674752982e9c11008f6b22e36f98fb689d69
MD5 5e89a5fead80eabc42b8de215be35fb0
BLAKE2b-256 6dde855558d0fe2c736f7f0323ad998e0820901354fbff70ed336041fb6d4b41

See more details on using hashes here.

File details

Details for the file agbpycc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agbpycc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for agbpycc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0bbc15dd2ad9dd4349f5656c4e108e6fc2b0cf41fad6c4e6640c8fcb8b99fa
MD5 e2cae5d2162228b48550aa5f2eda5fc6
BLAKE2b-256 25a0a2c43de6859bea7c46e89208783ec0b316e14415522bd87e8f9d49b9c281

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page