{"id":24578386,"url":"https://github.com/esshahn/pydisass6502","last_synced_at":"2025-04-23T20:17:08.013Z","repository":{"id":52830591,"uuid":"345372604","full_name":"Esshahn/pydisass6502","owner":"Esshahn","description":"A simple 6502 machine language disassembler written in Python.","archived":false,"fork":false,"pushed_at":"2023-01-17T02:28:49.000Z","size":104,"stargazers_count":16,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T20:16:47.015Z","etag":null,"topics":["6502","c64","disassembler","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Esshahn.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-07T14:50:00.000Z","updated_at":"2024-02-08T04:13:05.000Z","dependencies_parsed_at":"2023-01-18T01:45:33.582Z","dependency_job_id":null,"html_url":"https://github.com/Esshahn/pydisass6502","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esshahn%2Fpydisass6502","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esshahn%2Fpydisass6502/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esshahn%2Fpydisass6502/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esshahn%2Fpydisass6502/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Esshahn","download_url":"https://codeload.github.com/Esshahn/pydisass6502/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506146,"owners_count":21441723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6502","c64","disassembler","python"],"created_at":"2025-01-23T23:59:16.816Z","updated_at":"2025-04-23T20:17:07.992Z","avatar_url":"https://github.com/Esshahn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyDisass6502 \n\n\nA simple 6502 machine language disassembler written in Python.\n\nThis disassembler is in a very early phase but already quite functional.\nThe main disadvantage of this disassembler compared to UI based programs is the lack of an interactive interface to define which sections are code and which are data.\n\n## Usage\n\n```\npython3 disass.py -i filename [-o filename] [-e filename] [-nc]\n```\n\n`-i filename` or `--input filename`  \nBinary file to load, e.g. `game.prg` that you want to disassemble\n\n`-o outputfile` or `--output filename` (optional)  \nName of the genereated assembly code to be saved, e.g. `output.asm`. If no name is provided, the suffix `.asm` will be added to the input filename, e.g. `game.prg.asm`.\n\n`-e filename` or `--entrypoints filename` (optional)  \nIf used, user defined entrypoints will be parsed specifically as code or data sections. This is extremely helpful if you know that a specific section is clearly code and not data, see below. Check the example `entrypoints.json` for reference.\n\n`-nc` or `--nocomments` (optional, no params)  \nIf used, the address descriptions from the file `c64-mapping.json` will *NOT BE* be inserted as comments into the output file.\n\n## Examples\n\n```\npython3 disass.py --input flt.prg --nocomments\n```\n\nImports the file `flt.prg`, parses it without comments and writes the output assembly code as `flt.prg.asm` into the same directory.\n\n\n```\npython3 disass.py -i source/flt.prg -o code/flt.asm -e entrypoints.json \n```\n\nImports the file `flt.org` located in the `source` folder, parses it with comments and uses custom entrypoints defined in `entrypoints.json` and writes the output assembly code as `flt.asm` into the `code` folder.\n\n## JSON files\n\n`lib/opcodes.json`  \nA description of all 256 opcodes that are available for the 6502 processor, including illegal opcodes. You can add more keys to the list if you know what you're doing, otherwise this one is better be left as is.\n\n`lib/c64-mapping.json`  \nA list of significant addresses for the C64, like `D020` for the border color. Can be extended to your personal liking. Also more mappings for other 6502 based computers (C16, C116, Plus/4, C128, VC20) could be added as separate files. In addition, language translations could be added. Happily taking Pull Requests.\n\n`entrypoints.json`  \nList of addresses that should be marked as code or data section and override any other setting. Valuable if you know that a data section is code, or to peek into data sections and check if they are code. You can and should modify this file whenevery you disassemble a file.\n\n## Execute pydisass from anywhere\n\nYou might want to make pydisass available from any location in your terminal by just typing \n\n```\ndisass -i flt.prg\n```\n\nTo achieve this, follow these steps (at least on a Mac, feel free to add the correct way for Windows and Linux):\n\n1. Set the right location of your `python` installation in `disass.py`  \nDo this by changing the first line of the script, which reads `#!/usr/local/bin/python3`\n\n2. Change execution rights of the script  \nOpen your terminal, locate the folder `disass.py` is in and type into the terminal `chmod +x disass.py`\n\n3. Add the location of the file to your `PATH` environment  \nOpen your terminal and enter `cd`. Next, enter `sudo nano .profile`. This opens a text editor. In there, add the following line:\n\n```\nexport PATH=$PATH:/Users/username/pathto/folder\n```\n\nMake sure to adapt this line to your settings by replacing the `username` with your username and the `pathto/folder` with the right path to the location of the pydisass folder.\n\n4. Rename `disass.py` to `disass` (optional)  \nIf you like it nice and short, you can drop the `.py` suffix as well\n\nAfter restarting your terminal, you should be able to execute the disassembler from anywhere.\n\n\n\nFor more information check out the article I wrote about it: \nhttps://www.awsm.de/blog/pydisass/\n\n\n## ToDo\n\n* external config file for multiple ass dialects\n* cleanup code formatting\n* improve data formatting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesshahn%2Fpydisass6502","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesshahn%2Fpydisass6502","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesshahn%2Fpydisass6502/lists"}