Trying to decipher the mysteriously confusing WDC 65c02 SXB

Building your first 6502-based project? We'll help you get started here.
Aloha6502
Posts: 69
Joined: 17 Feb 2021

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by Aloha6502 »

Here is the "S19 Record Loader" portion of the monitor.

Code: Select all

;===============================================================================
; 'S' - S19 Record Loader
;-------------------------------------------------------------------------------

		cmp	#'S'
		if	eq
		 jsr	NextChar
		 cmp	#'1'		; Data record?
		 if 	eq
		  jsr	GetByte		; Extract length
		  bcs	.S19Fail
		  sta	ADDR_E+0
		  jsr	GetWord		; Extract address
		  bcs	.S19Fail
		  jsr	SetStartAddr
		  dec	ADDR_E+0	; Reduce count
		  dec	ADDR_E+0
		  dec	ADDR_E+0

		  ldy	#0
		  sty	ADDR_E+1
		  repeat
		   jsr	GetByte		; Extract data byte
		   bcs	.S19Fail
		   ldy	ADDR_E+1	; And save
		   lda	TEMP+0
		   sta	(ADDR_S),y
		   inc	ADDR_E+1
		   dec	ADDR_E+0	; Until line processed
		  until eq
		 else
		  cmp	#'9'
		  if 	eq
		   jsr	GetByte		; Extract length
		   bcs	.S19Fail
		   jsr	GetWord		; Extract start address
		   bcs	.S19Fail
		   lda	TEMP+0		; Copy to PC
		   sta	PC_REG+0
		   lda	TEMP+1
		   sta 	PC_REG+1
		  else
.S19Fail:	   jmp	Error
		  endif
		 endif
		 jmp	NewCommand
		endif
Quote:
Motorola S-record is a file format, created by Motorola in the mid-1970s, that conveys binary information as hex values in ASCII text form. This file format may also be known as SRECORD, SREC, S19, S28, S37. It is commonly used for programming flash memory in microcontrollers, EPROMs, EEPROMs, and other types of programmable logic devices. In a typical application, a compiler or assembler converts a program's source code (such as C or assembly language) to machine code and outputs it into a HEX file. The HEX file is then imported by a programmer to "burn" the machine code into non-volatile memory, or is transferred to the target system for loading and execution.
https://en.wikipedia.org/wiki/SREC_(file_format)


And here is a Windows tool to convert binary files to S19 format

https://www.keil.com/download/docs/4.asp

However it's not really obvious how the S19 data is loaded. Whether pasting/typing line-by-line or if a file can be opened for loading.
Attachments
S19.png
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by adrianhudson »

Aloha Aloha6502!

I'm late to this discussion - only just noticed it in the forum.

I use this board and know a little about it.

No, there is no provision to deal with interrupts if you switch banks away from the default. You could copy the WDC code to the other three banks so you can swap to whichever bank you want and it wouldn't notice.

Its a good board, let down seriously by the software support. I gave up with WDC's software, it is antiquated and doesn't play nice on newer versions of Windows - if I remember the problem was authority - running it with elevated privileges helped I think but as I said I gave up with it.

I use the NoICE debugger - it costs $79.95 but it has been the most useful piece of software I have bought in a VERY long time. I use it via the FTDI USB port which leaves the second onboard 6522 completely free.

Andrew Jacobs posted code to read and write FTDI USB (as serial COM) ports in his "w65c816sxb-hacker" Github project. I have used this code to read/write via the USB socket on the board. Monitor code is supplied with the NoICE debugger but you have to add character I/O routines yourself. Andrew's code "just worked". If you want to develop your own routines his code will give you a good start.

One thing - The WDC website says "W65C02S MPU running at 8MHz.". No it doesn't. At least mine doesn't. If you look at the board there are two canned oscillators - both 1.8432 mHz - one for the 6551 and the other provides phi2. Is yours the same?
viridi
Posts: 64
Joined: 10 Apr 2024

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by viridi »

As it will take some time for me to design and build my 6502 based computer and I wanted to experiment I also bought a 65C02SXB.
I expected that it had the same software as the 65C265SXB but it does not at least I could not use the EasySXB software I used for the 65C265SXB that I have laying around as well.

I found and I downloaded Andrew Jacobs w65c02sxb-monitor on my Macbook and It works like a charm. I learned be browsing trough this forum that he has past away that's very sad. Even though he is no longer with us, I wanted to thank him for this software. It is very useful.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by BigDumbDinosaur »

viridi wrote:
I found and I downloaded Andrew Jacobs w65c02sxb-monitor on my Macbook and It works like a charm. I learned be browsing trough this forum that he has past away that's very sad. Even though he is no longer with us, I wanted to thank him for this software. It is very useful.

It was quite a shock to us when we learned of Andrew’s untimely death.  He was a long time member and contributor to 6502.org and, among other things, was the author of a well-designed macroassembler for the 6502 family.  I believe his website has been preserved in its entirety, although I'm not certain about the details.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by GARTHWILSON »

BigDumbDinosaur wrote:
I believe his website has been preserved in its entirety, although I'm not certain about the details.
Mike put it here:  http://6502.org/users/obelisk/
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
viridi
Posts: 64
Joined: 10 Apr 2024

Re: Trying to decipher the mysteriously confusing WDC 65c02

Post by viridi »

GARTHWILSON wrote:
BigDumbDinosaur wrote:
I believe his website has been preserved in its entirety, although I'm not certain about the details.
Mike put it here:  http://6502.org/users/obelisk/
Great! I followed the link on his Github profile but the website was offline. Good to know that it is archived here.
Post Reply