This might sound like a really screwed up question, but does anyone know of a 6510-emulator written in 6510 machine code? I don't wanna write one if it really exists.
If someone feel they need an explanation, here it is:
I need to be able to test automatically generated code (on a c64) before actually letting it lose on the real CPU, to make sure it behaves. (No out of bounds memory access and only execution of permitted opcodes for example).
Anyone?
/Autoboy
6510 emulator written in 6510-machine code?
You can let the CPU do most of the decoding for you, after you do as much decoding as necessary to validate the instruction (and possibly modify it). Once it's validated/modified, copy it to an execution area in RAM which restores the processor state, has a NOP-padded slot for the instruction, then saves processor state again. I've used this in a couple of debugger/monitors on other 8-bit CPUs for their single-step mode and even on the PowerPC processor which is quite a different beast than the 6502.
- Mike Naberezny
- Site Admin
- Posts: 293
- Joined: 30 Aug 2002
- Location: Northern California
- Contact:
Re: 6510 emulator written in 6510-machine code?
autoboy wrote:
This might sound like a really screwed up question, but does anyone know of a 6510-emulator written in 6510 machine code? I don't wanna write one if it really exists.
http://www.floodgap.com/retrobits/kim-1/
It looks like he's done what you'd like to do, perhaps he'll share his source code with you.
Regards,
Mike
- Mike Naberezny (mike@naberezny.com) http://6502.org
-
6502inside
- Posts: 101
- Joined: 03 Jan 2007
- Location: Sunny So Cal
- Contact:
Re: 6510 emulator written in 6510-machine code?
This is a really old necropost, but I figured it was worth tacking on: the plan is to opensource 6o6 with the next release ("1.0") of the KIMplement, which will also be opensourced now that I'm satisfied with code quality, years and years later. 6o6 is the "6502-on-6502" virtualizer that it uses.
Machine room: http://www.floodgap.com/etc/machines.html
Re: 6510 emulator written in 6510-machine code?
Sounds like a good development!
-
6502inside
- Posts: 101
- Joined: 03 Jan 2007
- Location: Sunny So Cal
- Contact:
Re: 6510 emulator written in 6510-machine code?
Forgot to post it to this thread!
Discussion: https://oldvcr.blogspot.com/2024/04/vir ... 6-and.html
Code: https://github.com/classilla/6o6
Discussion: https://oldvcr.blogspot.com/2024/04/vir ... 6-and.html
Code: https://github.com/classilla/6o6
Machine room: http://www.floodgap.com/etc/machines.html
Re: 6510 emulator written in 6510-machine code?
There is such a program in Polish (SYMULATOR 6510) and German (6510 Einzelschritt-Simulator) but writen in BASIC.
The Polish version is in the attachment.
The instructions are in the program, if you have any problems, I can translate them.
The Polish version is in the attachment.
The instructions are in the program, if you have any problems, I can translate them.
- Attachments
-
- Symulator_6510.zip
- (7.24 KiB) Downloaded 83 times
Re: 6510 emulator written in 6510-machine code?
gregorio wrote:
There is such a program in Polish (SYMULATOR 6510) and German (6510 Einzelschritt-Simulator) but writen in BASIC.
The Polish version is in the attachment.
The instructions are in the program, if you have any problems, I can translate them.
The Polish version is in the attachment.
The instructions are in the program, if you have any problems, I can translate them.
The version you offered seems to be the german version, but with instructions in Polish added before the simulator is started.