Page 1 of 1
Online simulators for 65c02
Posted: Fri Jan 03, 2025 9:22 pm
by barnacle
I know of Nick Morgan's simulator
https://skilldrick.github.io/easy6502/simulator.html and also the Mass:Werk simulator
https://www.masswerk.at/6502/assembler.html
What I'm looking for - and can't find - is something similar but which uses the 65c02 (ideally WDC flavour) rather than the default 6502. Anybody able to point me at one? It needs to run in the browser, or be a Linux executable; I don't have access to Windows.
(As an aside, the assembler for masswerk doesn't complain at 65c02 mnemonics like phy/phx but produces neither code nor an error.)
Thanks,
Neil
Re: Online simulators for 65c02
Posted: Sat Jan 04, 2025 8:06 am
by drogon
I know of Nick Morgan's simulator
https://skilldrick.github.io/easy6502/simulator.html and also the Mass:Werk simulator
https://www.masswerk.at/6502/assembler.html
What I'm looking for - and can't find - is something similar but which uses the 65c02 (ideally WDC flavour) rather than the default 6502. Anybody able to point me at one? It needs to run in the browser, or be a Linux executable; I don't have access to Windows.
(As an aside, the assembler for masswerk doesn't complain at 65c02 mnemonics like phy/phx but produces neither code nor an error.)
Thanks,
Neil
Symon:
https://github.com/sethm/symon/ can run 65C02 code and now provides a variety of systems which it emulates.
It's in Java and I've run it under Linux in the past.
-Gordon
Re: Online simulators for 65c02
Posted: Sat Jan 04, 2025 9:04 am
by barnacle
That looks very handy, thanks, Gordon. Even a 6850 uart in there, which is nice since that's what I've got.
I have my own simulator, but I'm still not happy in many ways with the UI, and I'm not at all certain that the recent extensions to include some of the 65c02 extra instructions are correct (though they seem to work). And of course the issue with using your own tools to emulate something so that you can test the code you're writing means when it breaks, you're never quite certain _where_ it broke
Time to see if I can get it fired up.
Neil
Re: Online simulators for 65c02
Posted: Sat Jan 04, 2025 9:59 am
by BigEd
Acorn's micros used C02 in some situations: the Master, and the Second Processor. So, although it's not a naked MPU emulator, you might get something out of jsbeeb (browser), or beebjit (command line). The Basic includes an assembler, and the beebasm project has a very similar assembly syntax, and can write disk images suitable for the emulators.
Or, of course, you might be able to hack jsbeeb into a naked MPU offering!
Or, indeed, perhaps apple2js which offers a iie model
https://github.com/whscullin/apple2js#readme
But wait: here's 65C02_Emulator from JoeyShepard
https://github.com/JoeyShepard/65C02_Em ... ile#readme
The emulator displays the registers, memory, and an assembly listing while single stepping. The listing there is a stripped down version of the file output by the assembler used to assemble the file loaded into the emulator. Programs are loaded from a hex file when the page loads
and see also his Robot Game page
http://calc6502.com/RobotGame/summary.html
Edit perhaps see also the JS for Whiteflame's Foenijs, a Foenix 256jr/K emulator in JavaScript
https://www.white-flame.com/foenijs/
Re: Online simulators for 65c02
Posted: Sat Jan 04, 2025 8:41 pm
by barnacle
Well it looks like Symon does what I'm looking for with only minor changes in the code (a change in the origin and the hardware addresses for the 6850 uart) which are easy enough to revert when I need it on hardware.
Now to find out why my greater-or-equal test is behaving like a less-than-or-equal test... I suspect my parameters are the wrong way around.
Thanks, Gordon.
Neil
Re: Online simulators for 65c02
Posted: Sat Jan 04, 2025 9:32 pm
by rwiker
There's also
https://www.tejotron.com, but that seems to lack support for the 65c02 instructions.
Re: Online simulators for 65c02
Posted: Mon Jan 06, 2025 6:51 am
by barnacle
65c02 simulation is my specific need.
On the whole I like the Symon simulator with a couple of minor exceptions: I'd like to be able to turn on halt-on-breakpoint from a front-panel button (back and forth through a menu to a preferences window which turns out to be modal, so it has to disappear before you can use it...) and while the ability to change the font size in the console window is very necessary - the windows get lost on a 4k screen! - it's a shame that the font sizes in the memory and trace windows don't track that.
But I'm not complaining; it's working well and I thank the author for making it available.
Neil
Re: Online simulators for 65c02
Posted: Mon Jan 06, 2025 11:08 am
by barnacle
Actually, I may be wrong about stop-on-break; I think that that relates only to programmer-included actual BRK instructions.
The 'supervisor' breakpoints appear to be unconnected to that: if you have set a breakpoint in the breakpoint window, it will stop when it gets there and show (a lot!) of trace leading up to that point. It seems that the only way to stop it doing that is to remove the breakpoint from the list.
It would be really nice if there were a way to keep the list and just switch on which breakpoints are currently active (as most IDEs do).
Neil
Re: Online simulators for 65c02
Posted: Mon Jan 06, 2025 5:43 pm
by teamtempest
I've had great luck with using the Symon emulator to test my version of Tiny Basic. The only thing I really missed was the ability to save and load Basic programs. This limited my testing to whatever short programs I could type in each time.
Since Symon wants a ROM image to load into the address space of whatever system it's emulating, that means also having to provide the hardware vectors at the top of memory space for chip startup, IRQ and NMI. I cared only about chip startup, so I implemented that one. For the other two I didn't care, and just pointed them to null routines.
But if I did care about programmer-triggered breaks, I''d have put in an IRQ handler that knew how to recognize them (just in case you haven't thought about that

)
Re: Online simulators for 65c02
Posted: Mon Jan 06, 2025 6:54 pm
by barnacle
Conveniently, my assembler generates a binary full of (probably - I haven't looked) zeros between the end of the code and the last instruction. So I can org at 0xe000 with the usual vectors, and that gives me a convenient 8k
Neil
Re: Online simulators for 65c02
Posted: Sat Jan 11, 2025 6:31 am
by White Flame
Huh, so someone noticed Foenijs from here. It's certainly in progress, and not stable on chromium for some reason (FF is much better). The main issue for general 65c02 use is that getting code into it is kinda platform specific right now, uploading a FAT32 sdcard image, or the foenix-specific .pgz format directly.
But in order to make progress on foenijs, I've been trying to work on debugging tools. I finally have provenance tracking of what pushes what on the stack, so you can finally actually meaningfully see a stack trace instead of just a bunch of byte values! Each entry (bottom of the "CPU State" area) shows what PC and instruction/interrupt set the value at that stack location.
https://i.imgur.com/Va0oN08.png
Kinda really happy about this.
https://www.white-flame.com/foenijs/
Re: Online simulators for 65c02
Posted: Sat Jan 11, 2025 8:20 am
by BigEd
that's nice idea!
Re: Online simulators for 65c02
Posted: Thu Feb 06, 2025 3:47 pm
by barnacle
I am pleased to report that Symon appears still to be under development/maintenance.
I reported a minor bug (not displaying the full opcode for zero page indirect 65c02 LDA and STA) and suggested a feature update: adding a 'step over' button which allows the simulator to run until a subroutine returns, and received feedback for both.
Neil
Re: Online simulators for 65c02
Posted: Tue Apr 01, 2025 4:55 am
by barnacle
Update to this bug report and feature request: both are now addressed in version 1.5.0. Not fully tested yet but the ability to step over a subroutine until the appropriate rts saves a lot of adding and deleting breakpoints.
Kudos to Seth B.
Neil