Page 1 of 1
Resetting the Emulator When It Locks Up
Posted: Wed Jun 28, 2023 10:27 pm
by Martin Schmalenbach
Apologies if my searches have missed the answer to this, but...
... how can I 'reset' the emulator when it is running a user-loaded machine language routine that doesn't respond to CTRL-C - I'd like to get back to the BASIC environment, ideally with any BASIC program intact, without having to exit the emulator and then restart it?
Cheers in advance,
Martin
Re: Resetting the Emulator When It Locks Up
Posted: Thu Jun 29, 2023 12:19 am
by StephenHorn
It is up to the machine-language program whether or not it will respond to Ctrl-C or the Run/Stop key, and even if it normally handles those keys then it may still fail to return to the BASIC environment if the program becomes unresponsive. This is because machine language programs can do literally anything they want on the system, including overriding 99% of the kernal's interrupt process (and the remaining 1% is the minimal overhead necessary to invoke the interrupt in the first place). There is no "protected mode" or "ring 0" separate from a running process.
Edited to add: In fact, a machine-language program can take such total control over the system that, asides from that 1% overhead on interrupts, it can completely ignore the kernal, trash all of the kernal's memory, and generally do whatever it pleases to any writable component, which may well leave the X16 in a state where it cannot meaningfully return to the BASIC environment and thus requires a complete system reboot and reload in order to be started again.
Welcome to the metal. <3
Re: Resetting the Emulator When It Locks Up
Posted: Thu Jun 29, 2023 2:37 am
by TomXP411
Control+R triggers a “hardware” reset of the emulator.
(This really needs to change, but it is what it is for now.)
You can use “old” to recover a BASIC program, as a reset doesn’t generally clear memory.
Re: Resetting the Emulator When It Locks Up
Posted: Thu Jun 29, 2023 4:12 am
by Martin Schmalenbach
Thanks all, and esp. TomXP411 for the CTRL-R info!
Cheers
Martin