Close

Firmware examination

A project log for W65C816SXB investigation

Evaluating the W65C816SXB development board

keithKeith 03/10/2021 at 17:140 Comments

2021-03-09

Read the development board firmware ROM and had a go at disassembly to get an idea of how it works. I used da65 from the cc65 suite, but this can only disassemble 65C02 code. The firmware is part 65C816 code, so that code disassembles incorrectly. 

Although the firmware reserves 32K of the ROM, much of it is blank (0xFF) so the actual code is only about 1.6 K.

It looks like the USB-interfacing VIA does not use the timers or interrupts, just polled. I need to check the VIA PCR register initialisation code to ascertain this.

2021-03-18

Disassembled code did not reassemble using '816-capable assemblers. Gordon Henderson provided the answer. Disassembly to 65C02 code produces some instructions that are not 65C816 instructions. My assumption that the 65C816 instruction set was an inclusive superset of the 65C02 is false!

All the BBSn and BBRn are 'C02 instructions that have been replaced with other codes on the C816.

Some hand disassembly later, I have some 65C816 source code that assembles. I have uploaded it.

2022-05-12

Timothy Alicie, a chap with more skills and time than I have, has started from my files and done a full disassembly including identifying which bits are native 65C02 or enhanced 65C816. There are versions to assemble using cc65 and other assemblers, plus relocatable or enhanced versions.

See https://github.com/timali

Discussions