BZK 6502 Disassembler

Back to the main page

Table of contents

Introduction

Sorry for my bad English :) I hope you'll be able to understand this manual. If you have any questions, ask at the RHDN topic.

BZK 6502 Disassembler is a Lua script that is heavily and solely based on a .cdl file. What the script does is separates code from data, it doesn't make any assumptions like some other disassemblers. The more complete CDL file you possess, the more information the disassembler will receive, making it easier for you to create a full disassembly of your game.

Creating a disassembly doesn't always mean creating a perfectly compilable disassembly where you can edit and move any code you want. This takes time, and spending it on making such a disassembly is not rational if you're not going to edit much stuff in the game.

No, sometimes you just need to have a global view at the game code in order to learn how your game actually works, and to figure out the best way to edit it. Debugger is a great tool for studying the code in real time, but looking at the text files while using a powerful text editor has a lot of its own advantages.

Even if you don't have much romhacking skills, you can still create a disassembly with little effort in a couple of hours, mostly by playing the game and launching some scripts. I've tried to make everything as simple as I could afford.

Of course if you want to go further and create a perfect disassembly, then good news: output files are targeted on being compatible with a ca65 assembler. You still need to do a lot of manual work by yourself in order to label everything, but my Notepad++ scripts can save you a bunch of time and nerves doing that.

Features

Disassembler


  • Separate code from data using a CDL file
  • Display all 6 CDL flags, ROM File and NES Memory address
  • Use several table files to display symbols
  • Auto adding labels to RAM addresses
  • Additional info about each CPU address
  • Notepad++ scripts


  • Convert .byte to instructions
  • Convert .byte to .word/.dbyt + labels
  • Auto adding labels to Branches, Tables and JMP/JSR instructions
  • Other manipulations with bytes
  • And a couple of bonuses for Notepad++:

  • Syntax highlighting
  • Display matches counter of a selected text
  • Preparation before ca65 compilation (WIP)

    The idea is to have your assembly files as is (like keeping flags and addresses in files), but still being compatible with an assembler by launching one more script each time before compilation.

  • Make a basic compatibility with ca65
  • Allow user to write labels in any language
  • Convert text from any language into a list of bytes
  • Create .ram.nl file for FCEUX
  • Getting started

    Read next articles and perform this steps:

  • Step 1 - download the latest release from GitHub repository
  • Step 2 - play the game to log a CDL file
  • Step 3 - prepare input files and edit the config
  • Step 4 - start the disassembler with a LAUNCHME.bat file
  • Step 5 - install LuaScript plugin for Notepad++
  • Step 6 - polish assembly files with Notepad++ scripts
  • Step 7 - prepare assembly files for ca65 assembler
  • You can also watch the disassembler in action on this video (Russian language).