ZeroPage Pro - Ultimate Guided W65C02S Disassembler
Projekt 0333/0010 Copyright Carsten Meyer / chesslab.de
ZeroPage Pro is a full featured closed source command line disassembler for 6502 / 65c02 binary code files. ZeroPage Pro will be free for non commercial use.
- ZeroPage Pro V0.56d
- Manual V0.21a
- OS Windows 64 Bit
- Visual Studio 2017 Redist (VC_redist.x64.exe) https://aka.ms/vs/15/release/vc_redist.x64.exe
- disassembly of all 65c02 instructions
- codeFlow analysis to differentiate between code and data
- generates call graphs
- generates reference listings to all external addresses and I / O ports
- generates different output formats
- static memory access analyzing
- Jumptable support
- static reference counting
- Code / Data generation
- number of opcodes
- 6502 opcodes
- 65c02 only opcodes
- WDC 65c02 only opcodes
- number of code bytes (related to bin file size / related to address space)
- number of data bytes (related to bin file size / related to address space)
- generated code bytes per address call
- Read / Write
- All indirect jumps
- Data CharSet Extentions: ASCII, LED4DIG7, LCD24DIG7, PETSCII, LCD216DIG40
- falseCodeDetection() for automated data to code detection
- Auto LoadAdress Calculation (moves short files to AddressSpace End)
- StartAddressList sorting (optional)
- BRK and STP Treatment - END instead of NEXT in CodeFlow analysis (optional)
- IRQ StartAddress Treatment (optional)
- Constant Name Definition (Address and Value based) (optional)
- 64tass compatible assembly file generation (optional)
- 64tass macro support
- Guide file support
- Comments (top / line)
- Start addresses
- Jump tables
- Hi / Lo tables
- Address constants
- Value constants
- Manual labels
- Byte encoding
To do / To improve
- handles references to addresses not aligned with instruction (eg: self -modifying code)
- manual Startaddresslist Optimizer
- HTML output
By default the output of ZeroPage Pro includes as many usefull information as possible. The output can be reduced by setting some options to hide the information not needed. A special case is using the option “/tassOutput”, which restricts the output to be ready for a direct assembly process with 64tass assembler.
The output is basically organized in 5 columns which can be deaktivated individually (if needed).
ADDRESS BYTES ASCII LABEL MNEMONICS COMMENT
The output file contains all the content from all guide files and the info file. Main goal is to get an output with all information available, needed and used to generate the output file from the bin file. The content of the guide files and the info file can be manually restored from the output file if neccessary. So finally it is only needed to keep an eye on the output file.
Just copy ZeroPagePro.exe into your working directory and you are done or place it somewhere else an add the path to the path environment variable.
ZeroPagePro [options] /f <infile> [/o <outfile>]
/h or /help or /?
Shows the help / usage page. If ZeroPage Pro is called without arguments this page is also shown.
If set the default descriptions in the comment column are not used. This can be selectivly set for code and data sections.
By default all columns are shown. This setting switches off the specified columns.
The default charset is used if no specific charset is used for a specific data section using the .gbe guide file. If not set ASCII is used.
The default is 8 bytes per line. This options sets a new default value. The default value will be overwritten by .gbe guidefile settings.
Given start addresses are processed in unsorted order. This option sorts (ascending) all given start addresses. This can lead to different results in code detection through the flow based disassembling process.
Disables explicit adding the letter “a” after mnemonic with addessing mode “accumulator”
asl <-> asl a inc <-> inc a rol <-> rol a dec <-> dec a lsr <-> lsr a ror <-> ror a
This switch affects FlowControl analysis. If set BRK will be treated as illegal instruction. Assuming that code sections normally do not contain illegal instructions the analyzed byte block will be marked as data.
This switch affects FlowControl analysis. If set STP will be treated as illegal instruction. Assuming that code sections normally do not contain illegal instructions the analyzed byte block will be marked as data.
This switches off the load address (given or calculated) as possible start address.
This switches off the IRQ / BRK Vector as possible start address. If a load address is given and the highest bin file address does not reach the Vector space the vector is by default not used as start address.
This switches off the NMI Vector as possible start address. If a load address is given and the highest bin file address does not reach the Vector space the vector is by default not used as start address.
This switches off the RESET Vector as possible start address. If a load address is given and the highest bin file address does not reach the Vector space the vector is by default not used as start address.
This will overwrite some settings (mainly regarding display) to produce a ready-to-use assembly file which can directly be assembled with the 64tass assembler.
Usefull batch files
@echo off del mephisto4.bi2 del mephisto4.as2 ZeropagePro.exe /sortStartAdresses /treatLoadAddressAsStart /useExtension LED4DIG7 /f mephisto4.bin /o mephisto4.asm ZeropagePro.exe /tassOutput /sortStartAdresses /treatLoadAddressAsStart /useExtension LED4DIG7 /f mephisto4.bin /o mephisto4.as2 64tass -a -b -o mephisto4.bi2 -Wall mephisto4.as2 echo. fc /B mephisto4.bi2 mephisto4.bin
If an info file exists .ifo it will be included into the output file header section. The content is not interpreted and can contain information about the project or binfile. It is just a way to include whatever needed in an automated way into the output file.
Guide files are the heart of ZeroPage Pro. They are the main philosophy of how to use this disassembler and the right way to squeeze the last out of it.
Guide files can be shared and worked on collaboratively to describe the contents of a bin file as good as possible. ZeroPage Pro uses all these information to generate the best disassembly listing possible.
There are several different guide files, each one for its own suppose. You do not have to use guide files but you should.
- Al input files have to be in ANSI format.
- The filename has to be the same as the input file but with a guide file specific filename extention.
- Format: inputfilename.guidefileextention
Guide file contents will get included in the output file header section.
.gac - guide address constants
; Immediate Address Name 8001 WP 8103 BP
.gml - guide manual labels
; address label 8000 Start
.gvc - guide value constants
; value name 0 Zero 1 WP 2 WK 3 WB 4 WR 5 WQ 6 WK
.gsa - guide start addresses
; address 8000
.gjt - guide jump tables
; addressLoByteTable addressHiByteTable offset size name a000 a0010 01 0f Name
.ghl - guide Hi Lo (WIP)
; addressHi addressLo name
.gbe - guide byte encoding
- a set bytesPerLine value is valid till the next non zero value
- bytesPerLine at addressEnd + 1 is set to the default value
- bytesPerLine takes only affect inside data sections
- values of bytesPerLine = 0 are ignored. The value vaild before that address is continued than
- a lineWrap is caused if values changed from byte to byte
Column with will set according to the bytesPerLine value
; addressStart addressEnd bytesPerLine encoding 0d00 0dff 10 ASCII 0e00 0eff 4 LED4DIG7
.gmc - guide macro definition
; addressStart addressEnd macroName addressParam1 typeParam1 [addressParamN typeParamN] e000 e020 something e004 MACRO_ADDRESS e008 MACRO_BYTE e012 MACRO_ADDRESS e020 MACRO_ADDRESS_LO e021 MACRO_ADDRESS_HI
.gtc - guide top comments
Top Comments are shown directly above the given address embedded between two dash lines. The top comment can include spaces.
; address topcomment eb60 Example Top Comment
.glc - guide line comments
Line Comments are shown in the comment column of the line. In code sections, line comments are only displayed if the address points to the opcode byte (first). In data sections the existance of a line comments leads to a line split. The line comment can include spaces.
; address linecomment eb60 Example Line Comment
.ghv - guide hardware vector (WIP)
This guide file allows for customize the names and comments used for the hardware vectors.
; address vectorlabel vectorcomment targetlabel fffa HW_VECTOR1 "NMI Vector" NMI fffc HW_VECTOR2 "Reset Vector" Main_Reset fffe HW_VECTOR3 "IRQ / BRK Vector" IRQ_BRK
Sometimes data bytes are set to technically represent a char on a special kind of display (7 segments etc.). Use and try one of the following settings to turn these data bytes into readable text.
Standard ASCII decoding.
Special decoding for 7 segment displays (like 4 char LED displays in Mephisto Chesscomputers)
Special decoding for 7 segment displays (like 2 x 4 char LCD displays in Mephisto Chesscomputers)
Special decoding for 40 dot matrix displays (like 2 x 16 char LCD displays in Mephisto Chesscomputes)
Special decoding for Commodore text data (C64)
A good help for analyzing foreign bin files is the feature of ZeroPage Pro to group labels into types and have reference counters for them.
- “J” - JUMP - address is a jump target
- “R” - DATA_READ - data is read from this address
- “W” - DATA_WRITE - data is written to this address
- “V” - VECTOR - address (an the following) is accessed as vector address
- “M” - MANUAL - address label was manually given
- “T” - TABLEJUMP - address is a jump target from a jump table