Evaluating the W65C816SXB development board
To make the experience fit your profile, pick a username and tell us what interests you.
Rough disassembly of 65C02 based board. Easier to see what is going on here than in the 816 firmware.
plain - 200.51 kB - 04/06/2021 at 23:09
Rough disassembly information file
plain - 7.45 kB - 04/06/2021 at 23:09
text/plain - 18.99 kB - 03/17/2021 at 01:23
Information file for the da65 disassembler to roughly examine the firmware. The 65C02 code disassembles okay, but the 68C816 code does not.
text/plain - 8.93 kB - 03/11/2021 at 15:19
W65C816SXB firmware backup, just in case I need to restore my ROM. Resides in top 32K of the 128K chip.
octet-stream - 32.00 kB - 03/11/2021 at 15:15
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.
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.
Following instructions from here: https://wdc65xx.com/gettingstarted/816-sxb-getting-started/
Done. Alas it is Windows only, so I hade to install on a spare i3 laptop instead of my i7 desktop.
At first sight, this doesn't look too hard. I have already hacked BBC BASIC for the Acorn second processor 6502, to run on an experimental 65C02 board. The only I/O is through the USB channel, and that is trivial.
There is a thread on stardot.org.uk about BBC BASIC on the 65816. Seems it has been done for the Acorn Communicator but not very well, perhaps to meet deadlines.
I don't have time to modify the BASIC to take advantage of the 65816 instruction set and expand the built-in assembler, but it should run pretty fast.
http://mdfs.net/Software/BBCBasic/BBC/Basic4.zip is for the 65C02, which uses a subset of the 65C816 instruction set.
Discovered John Kortink has ported a 65C816 BBC BASIC onto his soft 65C02 second processor for the BBC micro. This is closed source, though if you had one running you could peek all the code bytes and disassemble them to analyse the firmware modifications.
My DE0-NANO FPGA and W65C816SX development boards arrived. I could do the porting work in the FPGA, but I don't want to wait for the CPU core to be compiled every time I make a tiny software mod. So I have installed all the new Western Digital development tools.
After emailing some big names of the 6502 world, I learned from the very long thread about it: https://stardot.org.uk/forums/viewtopic.php?f=2&t=21159 it seems that the main guy working on 65816 BASIC is Dominic Beesley who has a disassembly here https://github.com/dominicbeesley/CommunicatorBasic100 which has a fair few source files.
Looks like this is not a trivial job, if better programmers than me are having to work hard.
The assembler now handles all 65816 instructions, which is good. The software is purported to be ... inelegant for want of a better word. It has to deal with short and long addressing, the overhead of using a separate 'module' for arithmetic, and other stuff.
At this point I wonder if it is what I like about the 6502 - a well-known instruction set and architecture that is easy to use. Should I just port a simple 6502 BBC BASIC and then leave the potential of the 65816 modes to programmers with the time to harness it? Off the top of my head, I can't think of anything I would want a massive memory map. Maybe a memory-based disk system? Lots of graphics memory? I do big jobs on my PC and the development board does not have graphics. My spare time is scarce and my hobby projects are therefore fairly small.
The Communicator BASIC includes code for running all the BBC micro I/O such as keyboard, disks, screen etc. A tube version would be simpler and smaller, and indeed there is a thread about this for an FPGA version https://stardot.org.uk/forums/viewtopic.php?f=3&t=9975. Looks like a better starting point for me.
John Kortink has firmware for his 6502 second processor that uses a real ULA, 65C02/65C816 and a CPLD. It is obtainable from here: http://www.zeridajh.org/hardware/reco6502/updates.htm
After reading the manual and some disassembly work, I have a better idea of what it does and how. The BASIC is modified have extra commands to configure the system through calls to a modified MOS.
The configuration is loaded in a shift-register fashion. It is write-only, so I might be able to run his firmware and have the hardware simply ignore the shifted bits. If I can't use the configuration commands, then I might as well start from the unmodified 2nd processor BASIC and MOS.
The master clock is 44.2638 MHz, which can be divided to nice baud-rate generator compatible frequencies.
I have only disassembled the 65C02 version, using the da65 tool from the cc65 suite.
Alas it does not disassemble 65C816 code. Or compile C to 65C816 code either. I am inclined to implement just a plain 65C02 BASIC and let other people implement a 65C816 version if they have...
W65C816SXB ordered from Tindie, for $68.16 plus £15 postage US to UK. Much cheaper than Mouser who were charging £111.48 including postage.
2021-02-17 19:16 Item dispatched!
2021-02-19 11:15 Item leaves USA!
2021-02-24 21:19 Item clears customs and enters Royal Mail network.
2021-02-25 Item arrives. Yay!
Become a member to follow this project and never miss any updates