Programs po test 65816 symulator

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
Post Reply
gregorio
Posts: 77
Joined: 07 Feb 2023

Programs po test 65816 symulator

Post by gregorio »

I'm looking for programs to test my 65816 emulator.
I wrote a 65816 simulator on ARM Cortex.
I'm currently running it on STM32H750. It passed the entire test
65816 Test Suite. However, I would like to do more tests, especially to check its speed, to compare it with a real 65816.
What programs would you recommend?
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

which test suite do you mean? I find
https://github.com/gilyon/snes-tests/tree/main/cputest
(which it seems Daryl has picked up for the Kowalski simulator)
gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

Yes I used this with additional tests for BCD.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

that's good then!

You might like to run BBC Basic as ported by dominicbeesley to the 816. It can be found in
https://github.com/dominicbeesley/CommunicatorBasic100
gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

That would be an interesting challenge.
But I think I still need to add some features.
For now my system only simulates 65816 and has 512 KB of RAM.
I currently communicate using the SERIAL port and I don't have any operating system that provides I/O support.
I can load a Bin image file and run it.
It's basically the equivalent of The Kowalski SImulator
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

Serial should be fine for BBC Basic. It will use system calls for in and out, and you'd be providing a small OS shim which can talk to the serial port.
gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

UPss. I think I'm having trouble setting up the build. It seems that it will take me some time to solve it ;) Any suggestions for a first step ?
My system is 512 kRAM, no ROM and I/O add adres $007f00 accepts only LDA $7f00 / STA $7f00 and LDA $007F00 STA $007f00

I understand that BASIC communicates with the operating system through the COP number.
Is it true ?
gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

I managed to compile the communicator BASIC
I would like to recreate the OS, to do this I would need some description of its functions, first of all these:

Code: Select all

COP_00_OPWRC
COP_02_OPWRA                    ;print string at BHA
COP_03_OPNLI                    ;OS NEWL
COP_04_OPRDC                    ;OSRDCH
COP_06_OPOSB
COP_07_OPOSW
COP_0A_OPBGT
COP_0B_OPBPT
COP_0E_OPCOM
COP_0F_OPERR
COP_10_OPADP
COP_11_OPADF
COP_16_OPAEV
COP_18_OPRLH
COP_1A_OPFZB
COP_21_OPPRE                    ;YIELD
COP_24_OPCVD
COP_26_OPBHA                    ;get address of "ARITHMETIC"
COP_28_OPCMD
COP_29_OPRFR                    ;Get reference to Arithmetic module
COP_22_OPRLN                    ;; read line cf OSWORD 0
COP_2C_OPFMA
COP_2E_OPFPO
COP_44_OPOPN
COP_45_OPCLS
COP_46_OPEND                    ;OPEND
COP_4E_OPLOD
COP_4F_OPSAV
COP_54_OPRSP
COP_55_OPWSP
COP_57_OPRLL
COP_58_OPWLL
COP_5D_OPSTAR
COP_61_OPERC                    ;get error string to BHA
I found a website on the internet archive with files that I think are useful, unfortunately the files have disappeared. Does anyone have archived files from this website?
https://web.archive.org/web/20190607065 ... ommuni100/
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

Thank you for the link. And do you know more places where I could find information about this computer.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

You might find more on the stardot forums. But meanwhile, perhaps
https://chrisacorns.computinghistory.or ... cator.html
https://stardot.org.uk/forums/viewtopic.php?t=15639

There are not many of them around. I believe MAME will now allow you to experiment with it, although it's not fully working, so you might need to persuade it. It looks like the ROMs on mdfs.net correspond to the Briefcase model, for checksum matching purposes.

Perhaps see also my post over here
https://retrocomputingforum.com/t/acorn ... asking/939
dominicbeesley
Posts: 9
Joined: 16 Oct 2013

Re: Programs po test 65816 symulator

Post by dominicbeesley »

Sorry I meant to answer this topic when Ed prompted me but it slipped my mind.

You shouldn't need all of those COP calls to be implemented - I think the BBC Micro build and shim only do a handful

There's documentation of most of the Communictor OS here https://github.com/dominicbeesley/Commu ... e/main/doc and that git contains my disassembly of the Communicator's OS which has a many of the calls documented too. There's a html version here https://raw.githack.com/dominicbeesley/ ... LLK-COP_00 other modules of the OS are available in the git repository.

It has been a while since I looked at this but I think possibly the way to proceed would be to go with bas816new.asm file and go through and copy the IFDEF MOS sections and make new IFDEF GREGORIO sections

Then you'll need to set up the BASIC environment by making a customised init sequence (around line 767) where you setup a private direct page for BASIC and set up the memory location and size that BASIC uses to store its program.

A minimal first boot of BASIC will probably need simple implementations of OSRDCH, OSWORD (0) - read a line, OSWRCH/OSASCI to write a character. You could start by implementing the communicator COP calls but they are complicated with a load of stuff for setting up multi-tasking.

D
gregorio
Posts: 77
Joined: 07 Feb 2023

Re: Programs po test 65816 symulator

Post by gregorio »

I have a problem assigning ROMs to specific memory BANKS.
https://mdfs.net/System/ROMs/AcornMOS/Communicat/
I found that the COP instructions point to $FFB655, but I can't match any file to that area.
There are also no disassemblies of ROMv100-2.zip ROMv100-2
Interestingly, the MemoryMap file mentions ROM BANKS 0-4
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Programs po test 65816 symulator

Post by BigEd »

I've a vague recollection that after a COP, or in interrupt context, there's some different temporary mapping of ROMs. I could be wrong about that. Maybe there's some incomplete decoding?
dominicbeesley
Posts: 9
Joined: 16 Oct 2013

Re: Programs po test 65816 symulator

Post by dominicbeesley »

I think there's some monkeying with the mappings at boot time (to map the ROM containing MOS into bank 0 to catch the reset vector) but after that it all remains where you'd expect. It all happens at $B04F in the MOS module which is in the rom labelled "0" in the mdfs.net files - I can't recall how each ROM is mapped in to each bank of address space but I seem to recall there being some confusion.

D
Post Reply