6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 2:37 pm

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Jun 02, 2023 10:21 am 
Offline
User avatar

Joined: Thu Oct 12, 2017 10:51 pm
Posts: 90
Using a timer interrupt is interesting as it allows for much simpler logic as you don't need to follow execution flow. You do still need to be able to hook the interrupt vector, of course, and it's much harder to make cross-platform. The Commodores used a VIA, the BBC Micro and Oric have 6522s, the Atari has the bespoke POKEY... and the BBC Micro Second Processor doesn't have a timer at all. Which is nice.

Belatedly: one issue with semi-emulation (i.e. patching the instruction into the debugger code so that it can be executed in situ) is that the debugger has to make sure the stack is unmodified when this happens or else debugging code like 'tsx; lda 0x101, x' will fail. So there'll be some exciting code there.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 02, 2023 10:31 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Another option is to use a plug-in hardware emulator such as the MCL65+, and then use that to log an instruction trace/set breakpoints.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 02, 2023 10:35 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Arlet wrote:
Another option is to use a plug-in hardware emulator such as the MCL65+, and then use that to log an instruction trace/set breakpoints.


Or, what I do, printf FTW ... :-)

If you can blink an LED you can send a character down a UART, if you can do that then you can print strings, then numbers, then the world is your bi-valve...

I seriously haven't done anything more than that on the 6502 to bring a new system up since the late 70s...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 02, 2023 11:51 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
using prints for debugging is pretty underrated. i have a macro that prints a single character to serial without changing any flags or registers.
so when i have a program that crashes somewhere i can start by just putting a few prints along the main program flow like "a", "b", "c". when i then run it i can see which is the last character it prints before crashing, which gives me a rough idea of where the issue might be.

of course prints are not as useful when you try to debug existing code sitting in ROM somewhere that you cannot reprogram at will


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 02, 2023 1:09 pm 
Offline
User avatar

Joined: Thu Oct 12, 2017 10:51 pm
Posts: 90
I have done that --- I've brought boards up, in fact, where the only feedback was whether a light comes on or not. And my general opinion of it is that having a real debugger is so, so much easier!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

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