6502bench

- Introduction
- About Disassembly
- Using SourceGen
  - Moving Around
  - Making Edits
  - Labels & Symbols
  - Editing Data Operands
  - Generating Code
- Digging Deeper
  - String Formatting
  - Local Variables
  - Inline Data
  - Odds & Ends
- Advanced Topics
  - Address Tables
  - Extension Scripts
  - Visualizations
- Suggestions

## A Few Suggestions

The hardest step in a journey is often the first. Here are a few suggestions to help you on your way.

- Start with a small project (< 1KB). If you haven't disassembled code before, this is the time to play with different conventions, like whether to use MixedCase or underscore_separated or SCREAMING_CAPS for labels.
- Use the program thoroughly. Understand all of what it does.
- Start with easily identifiable subroutines. If a chunk of code is reading from the keyboard, you can make reasonable guesses about the purpose of the code that interacts with it. The start of the program is often the hardest place to begin, because it usually just initializes a bunch of stuff you haven't identified.
- Expect to figure out little pieces. Use what you learn from these to figure out other little pieces. It's a jigsaw puzzle, not a book.
- Don't get discouraged if there's a ton of code that you can't make sense of. It won't make sense at first. Keep chipping away.
- Read On Disassembly for additional thoughts.

Remember that SourceGen works by tracing through code from marked start points, rather than treating everything as code and requiring you to mark all the data items. Begin each project by finding the code. Identify external entry points, format tables of addresses, and find JSRs that are followed by inline data. Use an extension script to handle the inlines so you won't keep tripping over them. If parts of the program are relocated to a different address, set the appropriate address overrides.

Code start tags are rarely needed, and code end tags are almost never needed. You shouldn't have to spend a lot of time manually tagging things. If a piece of code isn't being found, it's usually best to figure out why the code that calls it isn't being found, instead of trying to tag it and forge ahead from that point. It might be dead code that's never called, or it might be called from a table that you can format to add code entry tags for multiple addresses with a single operation. Taking the time to find the table and format it is faster than hand-formatting dozens of little handlers, and it's something you'll need to do eventually anyway.

« Previous