W65C02SXB board
Re: W65C02SXB board
Welcome! That's a nice idea, that we could at least signpost this thread as a resource and perhaps even make a document from it.
BTW, when you add yourself to a group (in linux), if you're working from the command line it should be enough to use 'newgrp' to get the group access live. If you're working from GUI tools it should be enough to logout and login again.
BTW, when you add yourself to a group (in linux), if you're working from the command line it should be enough to use 'newgrp' to get the group access live. If you're working from GUI tools it should be enough to logout and login again.
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: W65C02SXB board
abqlewis wrote:
Andrew,
If you don't mind, I have a few questions/discussions/rambles :
1) To anyone else trying this on Linux, I had to add myself to the dialout group, AND restart to get it to work.
If you don't mind, I have a few questions/discussions/rambles :
1) To anyone else trying this on Linux, I had to add myself to the dialout group, AND restart to get it to work.
abqlewis wrote:
2) Do I have to do anything special to the code I load, to make sure that I returns to your monitor when it's done? In other words, if I load a program with the 'S' command and then run it with the 'G' command, HOW does it get back to the monitor, or DOES it get back?
Code: Select all
RESET:
00:0091' 78 : sei
00:0092' D8 : cld ; Ensure binary mode
00:0093' A2FF : ldx #$ff ; Reset the stack
00:0095' 9A : txs
repeat ; Setup vectors
00:0096' BD???? : lda VECTORS,x
00:0099' 9D707E : sta IRQV,x
00:009C' E8 : inx
00:009D' E004 : cpx #4
00:009F' D0F5 : until eq
00:00A1' 20???? : jsr NewLine
00:00A4' A200 : ldx #TTL_STR
00:00A6' 20???? : jsr ShowString
00:00A9' 20???? : jsr NewLine
repeat
00:00AC' 0000 : brk #0 ; And enter monitor
00:00AE' 80FC : forever
abqlewis wrote:
3) My plan for now is to find a cross-assembler/compiler that runs in Linux (thinking cc65) that can make an S19 file (or something I can script into it), and loading through your monitor until I get something that works. Does this fit into what your monitor is meant for?
The monitor can load S19 files but the uploader itself handles S19, S28 or WDC's binary format. The monitor is good for loading and debugging small programs but a if you need to use all the memory then the uploader is a better option for getting code in memory and starting it.
abqlewis wrote:
4) A sub-discussion in the thread is about re-programing the flash. One of my theories is that I can dump the contents of ROM with your monitor and write a little script to make it into an SRecord file as a backup to the existing TIDE ROM. Does this make sense? I don't have a programmer (with adapters) yet, but that's next. I need to investigate more, because this level of detail in hardware is a little out of my realm.
Code: Select all
java -cp "Dev65.jar;jSerialComm-2.6.2.jar" com.wdc65xx.sxb.Uploader -port COM6 savebin 8000 8000 rom.bin
java -cp "Dev65.jar;jSerialComm-2.6.2.jar" com.wdc65xx.sxb.Uploader -port COM6 save 8000 8000 rom.s28
abqlewis wrote:
5) I copied your run.sh command but removed the "term" parameter. This allows your program to just load your monitor into RAM, and then I can just run the Linux "screen" anytime I want to connect to the board.
abqlewis wrote:
6) As far as the ROM is concerned, I think I could continue to uses the old TIDE ROM where it is and add my rom-program to a different "page" of the ROM. The docs mention changing ROM banks, but don't really say how. I've gleaned from the schematic that it involves the CA and CB ports of VIA2. I'm not quite there yet, but I will be.
My 816/265 hacker programs have commands to change ROM and XMODEM download into flash but I haven't done 134/02 versions yet.
I've been discussing revising the boot ROM with another developer who is also working with WDC on the FPGA versions. The upgrade would include a flash programming option as this is already provided on the C165.
You should check the speed of the CPU oscillator Y2 next to the USB socket. It should be 8MHz but the latest batch of boards have the same 1.8432MHz oscillator used for the ACIA chip (Y1) mounted by mistake. (Someone put the wrong reel in the pick and place machine). I might try to fix my board myself but the oscillator is a bit too close to the VIA socket and I don't want to melt it.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
Re: W65C02SXB board
abqlewis wrote:
3) My plan for now is to find a cross-assembler/compiler that runs in Linux (thinking cc65) that can make an S19 file (or something I can script into it), and loading through your monitor until I get something that works. Does this fit into what your monitor is meant for?
Code: Select all
rubyOsCode.srec: rubyOs
@rm -f rubyOsCode.srec
@echo [rubyOsCode.srec]
@srec_cat rubyOs -binary -offset 0x1000 -o rubyOs.srec
rubyOs: $(OBJ)
$Q echo [Link]
$Q ld65 -t none -S 0x1000 -vm -m rubyOs.map -o rubyOs $(OBJ)
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Re: W65C02SXB board
I too managed to get my W65C02SXB up and running using some of the tools from here. I eventually wrote up my own python script as a learning exercise:
https://github.com/kalj/sxb
As part of this I (manually) disassembled the flash image, and got this:
https://gist.github.com/kalj/66b23c4405 ... 50555af283
I've kind of tried to add comments / label names which describe what it seems to do. There are still quite a few question marks remaining, e.g.
* What's up with those pieces of seemingly dead code? (e.g. at $83cd and $84b9)
* Why is the code sometimes making weird unnecessary jumps just to return back immediately (there are a lot of "functions" which just do RTS)?
* What is the stuff stored at $8080 which sort of looks like an array of addresses? I don't see this being used anywhere.
NB: If you think there are any copyright problems with publishing that code, I can take it down again.
https://github.com/kalj/sxb
As part of this I (manually) disassembled the flash image, and got this:
https://gist.github.com/kalj/66b23c4405 ... 50555af283
I've kind of tried to add comments / label names which describe what it seems to do. There are still quite a few question marks remaining, e.g.
* What's up with those pieces of seemingly dead code? (e.g. at $83cd and $84b9)
* Why is the code sometimes making weird unnecessary jumps just to return back immediately (there are a lot of "functions" which just do RTS)?
* What is the stuff stored at $8080 which sort of looks like an array of addresses? I don't see this being used anywhere.
NB: If you think there are any copyright problems with publishing that code, I can take it down again.
Re: W65C02SXB board
Surely some interesting findings in there! Thanks for sharing the result of your explorations...
-
SpaceCoaster
- Posts: 33
- Joined: 11 Apr 2019
Re: W65C02SXB board
Attached is my disassembly of the WDC65c816SK WDCMON. I think I decoded the jump table. Perhaps it will help you fill in the gaps.
It seems to me that the 65C02 contains code that is only relevant for the 65C816.
The attached file produces the same bin as the ROM on the W65C816SXB board when assembled with ca65.
I have also attached sxb.inc which is needed to assemble sxb.s.
Finally, I have added a listing so that the oddities (using absolute addresses for zero page) are more apparent.
It seems to me that the 65C02 contains code that is only relevant for the 65C816.
The attached file produces the same bin as the ROM on the W65C816SXB board when assembled with ca65.
I have also attached sxb.inc which is needed to assemble sxb.s.
Finally, I have added a listing so that the oddities (using absolute addresses for zero page) are more apparent.
- Attachments
-
- sxb.lst.txt
- (52.27 KiB) Downloaded 180 times
-
- sxb.inc.txt
- (4.49 KiB) Downloaded 138 times
-
- sxb.s
- (25.85 KiB) Downloaded 170 times
Re: W65C02SXB board
kalj wrote:
I too managed to get my W65C02SXB up and running using some of the tools from here. I eventually wrote up my own python script as a learning exercise:
https://github.com/kalj/sxb
https://github.com/kalj/sxb
I only implemented the info, getstate and read memory commands (that was needed for the getstate command. I can create buttons for some command to make it easier like for the getstate command. It could use some polishing the received bytes good be presented better.
I would be awesome to create an in browser IDE for the board. But that would take some time to build. I will make it available on the web some day and also make it opensource so you can all have a look at the sources.
kalj wrote:
As part of this I (manually) disassembled the flash image, and got this:
https://gist.github.com/kalj/66b23c4405 ... 50555af283
I've kind of tried to add comments / label names which describe what it seems to do. There are still quite a few question marks remaining, e.g.
* What's up with those pieces of seemingly dead code? (e.g. at $83cd and $84b9)
* Why is the code sometimes making weird unnecessary jumps just to return back immediately (there are a lot of "functions" which just do RTS)?
* What is the stuff stored at $8080 which sort of looks like an array of addresses? I don't see this being used anywhere.
NB: If you think there are any copyright problems with publishing that code, I can take it down again.
https://gist.github.com/kalj/66b23c4405 ... 50555af283
I've kind of tried to add comments / label names which describe what it seems to do. There are still quite a few question marks remaining, e.g.
* What's up with those pieces of seemingly dead code? (e.g. at $83cd and $84b9)
* Why is the code sometimes making weird unnecessary jumps just to return back immediately (there are a lot of "functions" which just do RTS)?
* What is the stuff stored at $8080 which sort of looks like an array of addresses? I don't see this being used anywhere.
NB: If you think there are any copyright problems with publishing that code, I can take it down again.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: W65C02SXB board
SpaceCoaster wrote:
Attached is my disassembly of the WDC65c816SK WDCMON...
Looks like someone’s superannuated 65C02 code.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: W65C02SXB board
BigDumbDinosaur wrote:
SpaceCoaster wrote:
Attached is my disassembly of the WDC65c816SK WDCMON...
Looks like someone’s superannuated 65C02 code.
Re: W65C02SXB board
I uploaded the source code of my web based tool for the W65C02SXB at https://github.com/sandergroen/Web-W65C02SXB. It uses the Web Serial API because it is an experimental API not all browsers support this. It only works in Chrome, Edge and Opera for now. I will publish it somewhere so I have a portable tool that does not require any installation other than one of there webbrowsers
.
It does not implement every command available for the board yet. But it should be enough to write bytes to memory and run that.
I hope to figure out a way to write to the flash rom. Does anyone know how to do this? I want to be able to store programs there someday so I don't have to program it over and over again.
What I also want to add to this tool is an assembler so I can code in assembly from the browser and run that on the board (entering bytes is getting tiresome and error-prone). I know there are Javascript libraries to do that. Does anyone know if there is a good one?
It does not implement every command available for the board yet. But it should be enough to write bytes to memory and run that.
I hope to figure out a way to write to the flash rom. Does anyone know how to do this? I want to be able to store programs there someday so I don't have to program it over and over again.
What I also want to add to this tool is an assembler so I can code in assembly from the browser and run that on the board (entering bytes is getting tiresome and error-prone). I know there are Javascript libraries to do that. Does anyone know if there is a good one?
Re: W65C02SXB board
viridi wrote:
I hope to figure out a way to write to the flash rom. Does anyone know how to do this? I want to be able to store programs there someday so I don't have to program it over and over again.
https://projects.drogon.net/porting-my- ... 5c134-sxb/
-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Re: W65C02SXB board
drogon wrote:
viridi wrote:
I hope to figure out a way to write to the flash rom. Does anyone know how to do this? I want to be able to store programs there someday so I don't have to program it over and over again.
https://projects.drogon.net/porting-my- ... 5c134-sxb/
-Gordon
Re: W65C02SXB board
Ah, I found the S19 Record Loader code of Andrew Jacobs. I will have a look. Also in the other topic about this board I found some information.
Re: W65C02SXB board
BigDumbDinosaur wrote:
SpaceCoaster wrote:
Attached is my disassembly of the WDC65c816SK WDCMON...
Looks like someone’s superannuated 65C02 code.
I also see that sometimes f: is used and sometimes not.
Code: Select all
sta f:exec_k
lda exec_k
The WDCMON is used for both the 65C02 as well as the 65C816 based boards. I'm only interested in the 65C02 at the moment. The program is useful but I would like to strip it down so I want to remove al 65C816 stuff. I have a new empty flash rom (SST39SF010A the same as on the board) that I can use so I can get the preinstalled one out. So I can't mess up the original installed program. I also want to add some functionality myself or rewrite some stuff maybe.
Re: W65C02SXB board
I tried to figure it out. Could it be that f: is used for status flags and a: for addresses? Is it some kind of convention? How does the assembler handle this syntax? Or is this source code incomplete?