6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 1:52 pm

All times are UTC




Post new topic Reply to topic  [ 203 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 14  Next
Author Message
PostPosted: Mon Mar 11, 2013 3:13 pm 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
Klaus2m5: yes, the ignored reads don't have any effect without other hardware attached :-)

Unfortunately, I didn't write down the exact instruction that failed, and I fixed all of them at the same time. It was something like STA $D0,y - with y > $30: it was writing to page 1, because I was doing a 16-bit add. When my current test-run (a full run of your tests comparing all memory reads and writes to the gate-level implementation) finishes, I'll try to re-break it and find that problem again.

I didn't change anything about the file: just compiled it as-is, with the binary image starting at $a.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 11, 2013 3:49 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
zellyn wrote:
It was something like STA $D0,y - with y > $30


There is no STA zp,y in the 6502 instruction set and assemblers convert this to STA abs,y. This is expected to cross into the next page.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 11, 2013 3:59 pm 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
Ugh. Serves me right for making up examples without checking. I'll get back here when I have a chance to re-break my emulator.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 12:20 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Does anyone know of an assembler that can run on the Mac OS and assemble this file, or that this file can be (reasonably) trivially adapted to? I don't have access to Windows, and I tried to run a Linux assembler on a VM, but the binary download was missing some dependency that I simply wasn't about to go trying to track down. And the assembler didn't have source code, so I couldn't rebuild it.

I tried loading the binary that's with the source code, and running that, but it's just nonsense trying to figure out where it's all locked up without an assembly listing, plus I may have to play with things (since BRK doesn't work on my system, nor do interrupts).


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 12:40 am 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
I've been running it in VirtualBox, with a shared folder.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 8:32 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
whartung wrote:
I tried loading the binary that's with the source code, and running that, but ...

Which binary? Which source code? Sorry, too little context to be of any help here.
Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 3:21 pm 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
whartung, here's what I've been doing.

I set up an Ubuntu VirtualBox image, with a shared folder. I then downloaded and installed the 6502 assembler from http://www.kingswood-consulting.co.uk/assemblers/, and used the command line specified in the functional test source. It works just fine for me (on Mac OS).

I intend to eventually write an assembler in go, which will be trivially cross-platform, but haven't gotten around to it yet.

Zellyn


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 5:11 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
zellyn wrote:
I set up an Ubuntu VirtualBox image, with a shared folder. I then downloaded and installed the 6502 assembler from http://www.kingswood-consulting.co.uk/assemblers/, and used the command line specified in the functional test source. It works just fine for me (on Mac OS).


Yea, the linux I was using didn't, so maybe I'll try it with Ubuntu. I have a bunch more diskspace so firing up another VM shouldn't be a problem.

Quote:
I intend to eventually write an assembler in go, which will be trivially cross-platform, but haven't gotten around to it yet.


Yea, I have an assembler, I'm just not motivated to fix it to build this project. It's mostly missing macros, but other things as well. I just want to fix the simulator of any problems, then go back and tackle the assembler.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 5:12 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
BigEd wrote:
whartung wrote:
I tried loading the binary that's with the source code, and running that, but ...

Which binary? Which source code? Sorry, too little context to be of any help here.


From the Tools page, there's a link to cl_6502, a simulator in Common Lisp up on github, which seems to be the source hosting point for this test suite. There's also a binary of it hosted there as well.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 28, 2013 6:20 pm 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
The cl-6502 github repo does have an up-to-date version, thanks to BigEd's pull request. The authoritative source is the "Downloads" section of http://2m5.de

I have a version here too: https://github.com/zellyn/go6502/tree/master/tests

Beware that the lowest referenced memory address is $000A, so depending on what format you assemble to, it may need to be loaded there. Some assembler formats are sparse: they include only the relevant ranges, and omit the gaps between them. You can see that in my tests, I assembled it without gaps, but still need to load starting at location $000A: https://github.com/zellyn/go6502/blob/m ... est.go#L61

Hope that helps.

Zellyn


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 29, 2013 9:30 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Thanks for clarifying what you did, whartung! Same as zellyn, I found I had to use the specific assembler the test suite is written for, but that was straightforward for me because I already run Linux - as it happens, Ubuntu. Both Ubuntu and Debian are usually pretty good for resolving dependencies:
apt-file find filename
sudo apt-get install packagename
(And if you don't have apt-file, then "sudo apt-get install apt-file" will get it.)
Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 29, 2013 5:46 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
BigEd wrote:
Thanks for clarifying what you did, whartung! Same as zellyn, I found I had to use the specific assembler the test suite is written for, but that was straightforward for me because I already run Linux - as it happens, Ubuntu. Both Ubuntu and Debian are usually pretty good for resolving dependencies:
apt-file find filename
sudo apt-get install packagename
(And if you don't have apt-file, then "sudo apt-get install apt-file" will get it.)


I got ubuntu up and running in VirtualBox last night, but I wasn't able to get the host enhancements or whatever they're called installed to get shared folders working, so I'll try to get that working some more tonight.

If y'all are having success with it, I'm sure it should drop right in once I get it up and running. If all else fails, I could probably spool up a WEBDAV share on the linux box and mount that on the Mac -- that would probably work fine for my needs as well.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 29, 2013 5:49 pm 
Offline

Joined: Thu Feb 28, 2013 6:34 am
Posts: 16
Location: San Francisco, California
@whartung: If you simply want an unmodified compilation of the binary, you can grab it from my repo and load it at $000A. However, I strongly recommend having a listing handy with annotated memory addresses...


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 07, 2013 5:38 pm 
Offline

Joined: Wed May 22, 2013 5:24 pm
Posts: 2
I guess it's about time I made my first post. I'm the author of cl-6502[0].
@Klaus: Your test suite is fantastic. Thank you so much for making it. It made my life much easier as someone new to hardware emulation.

I've successfully run the tests (with decimal mode disabled) on lib6502[1] after a small patch to the PHP opcode[2]. It completed in about 0.1 seconds...roughly 100x faster than cl-6502. -_-
py65 also completed the tests as reported before by @BigEd. I took the liberty of timing it with a small script[3]. py65 completes the test in about 126 seconds... roughly 10x slower than cl-6502. :P
Obviously, these benchmarks are both sloppy and just for fun. FWIW, I have some optimizing left to do.

Cheers,
B

[0]: http://github.com/redline6561/cl-6502
[1]: http://piumarta.com/software/lib6502/ Command used was 'time ./run6502 -l a test.bin -R 1000 -X 3c37'
[2]: Told ya it was small.
-#define php(ticks, adrmode) phR(ticks, adrmode, P)
+#define php(ticks, adrmode) phR(ticks, adrmode, P | flagX | flagB)
[3]: bench.sh
#!/usr/bin/python
import py65.monitor
m = py65.monitor.Monitor()
m.do_load('test.bin a')
m.do_goto('1000')
exit()


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 23, 2013 11:21 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Great speedup! And welcome to the forum!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 203 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 14  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: