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

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon May 23, 2022 5:57 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
How do I programmatically trigger the RESET vector, and bring a 6502 CPU back to the state it was when it was first turning on?


Last edited by jeffythedragonslayer on Sat Aug 20, 2022 7:40 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 23, 2022 6:01 pm 
Offline

Joined: Sun Jun 29, 2014 5:42 am
Posts: 352
The nearest you can do is to execute:
Code:
JMP (&FFFC)

but this only resets the CPU, not any peripherals, so it's not really the same as a power-up reset.

Dave


Top
 Profile  
Reply with quote  
PostPosted: Mon May 23, 2022 6:39 pm 
Offline
User avatar

Joined: Sat Jul 24, 2021 1:37 pm
Posts: 282
If you'd like to trigger a hardware reset, you can wire up a pin from your VIA to the reset pin, being careful to never set it as output high (or preferably add a diode with its cathode towards the VIA for safety). Again that's not like cycling the power but it will reset more peripherals

_________________
BB816 Computer YouTube series


Top
 Profile  
Reply with quote  
PostPosted: Mon May 23, 2022 7:01 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
For interest, there are threads over on stardot explaining the rather different situations of the BBC Micro and Acorn's Electron, with respect to simulating a cold boot:
How to force a hard reset (CTRL+BREAK)?
Simulate a cold boot on the Electron

In effect, there are two challenges: resetting all the system state which would have been reset by powering up, and getting the OS to do the things it would do at power up.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 21, 2022 11:20 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
Thanks, I was able to code up a soft reset proc to reboot the CPU with the JMP instruction.


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

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: