6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Sep 25, 2024 6:14 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Tue Jan 03, 2017 9:12 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
Here it is: https://github.com/DavidBuchanan314/6502-emu

Nothing special, but it's completely free of macros which I personally find hard to read.

I started this project so I could debug programs for my SBC more easily, so it has the same hardware (so far only the 6850 UART is actually implemented).

I also plan to implement the GDB protocol, for debugging purposes.

I haven't implemented Decimal mode yet, but ehBasic apparently runs fine without that.

Edit: Adjusted README wording to avoid sounding over-confident :)


Last edited by DavidBuchanan on Tue Jan 03, 2017 9:31 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:16 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Well done! I see you describe it as bug-free(!) - does that mean you've passed Klaus' test suite? Or maybe a different test suite?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:23 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
BigEd wrote:
I see you describe it as bug-free(!)

It looks like memory doesn't wrap around.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:25 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
BigEd wrote:
Well done! I see you describe it as bug-free(!) - does that mean you've passed Klaus' test suite? Or maybe a different test suite?


Perhaps my wording was too ambiguous, the "relatively" part was also meant to refer to the bugs :lol:

But yes, I have tested it with Klaus's tests, up to the part where it tries (and fails) to run the decimal mode tests.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:26 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
Arlet wrote:
BigEd wrote:
I see you describe it as bug-free(!)

It looks like memory doesn't wrap around.


Could you point to where? I tried to always access withthe index as a uint16_t (which inherently wraps), or with "& 0xFFFF" when addition is involved.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:33 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
ehBasic's HEX$() will malfunction without a proper decimal mode, but that's a very minor issue.

Mike B.

P.S. You are certainly welcome to use my BCD patches, with my blessing.

viewtopic.php?f=2&t=2052&p=37758&hilit=chambers#p37758


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:47 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
>relatively
Ah! But glad to hear you've passed Klaus' tests - the decimal tests are last, so you can only fail those by passing all the previous ones.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 9:51 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
DavidBuchanan wrote:
Arlet wrote:
BigEd wrote:
I see you describe it as bug-free(!)

It looks like memory doesn't wrap around.


Could you point to where? I tried to always access withthe index as a uint16_t (which inherently wraps), or with "& 0xFFFF" when addition is involved.


Ah, you were right. Some of my address-mode decoding functions didn't wrap. I think I've fixed them now.

Thanks for pointing that out.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 10:02 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
That's interesting - some cases not yet covered by Klaus' tests. Could you raise an issue perhaps?
https://github.com/Klaus2m5/6502_65C02_ ... sts/issues
(If not, perhaps I can)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 10:14 pm 
Offline
User avatar

Joined: Mon May 04, 2015 10:55 am
Posts: 26
Location: UK
BigEd wrote:
That's interesting - some cases not yet covered by Klaus' tests. Could you raise an issue perhaps?
https://github.com/Klaus2m5/6502_65C02_ ... sts/issues
(If not, perhaps I can)


The bugs I just fixed were fairly harmless, and would only have any effect if the program counter was in the interrupt vectors (so can't really be tested against).

However, my relative adressing also failed to wrap, but it didn't actually matter because the program counter is a uint16_t (so in practice the value is wrapped) - If it wasn't that could have caused some nasty issues, so perhaps it could be added to the tests.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 10:29 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
No harm in wrapping by using 16 bit types, I think.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2017 11:48 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
DavidBuchanan wrote:
I started this project so I could debug programs for my SBC more easily, so it has the same hardware (so far only the 6850 UART is actually implemented).


There's something about stepping through the CPU in your IDE that certainly can make debugging your code a lot easier.

The problem I had later on, though, when debugging the Forth I was porting, was simply the bugs were higher level, and debugging at the instruction level, much less even small within the CPU, simply became far too much detail. I had to do stuff at a higher level. Not quite debugging Forth in Forth, but closer to that. It's times like that when you want NEXT to be primitive.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: