68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Is there a way to force-close any app at any time?
Posted by: chip-64bit on 2026-04-27 09:11:30
Hello everyone, I’m new to the 68K Mac. I’m trying to write code in the emulator, but my code crashes frequently. I don’t know how to force-quit an app stuck in an infinite loop, so I’m wondering if there’s a tool similar to `kill 9` in Linux that can force-quit an app. Thanks in advance.
Posted by: Nixontheknight on 2026-04-27 09:29:08
click on the app that's stuck in an infinite loop, hit hold command (Apple) and option (alt), and press escape, you should see a dialog box that says "force quit 'app'?" click OK
Posted by: chip-64bit on 2026-04-27 09:32:10
click on the app that's stuck in an infinite loop, hit hold command (Apple) and option (alt), and press escape, you should see a dialog box that says "force quit 'app'?" click OK
Thanks, I'll give this a try. Is this at the system level, or does it depend on the application's event handling?
Posted by: Nixontheknight on 2026-04-27 11:20:02
Thanks, I'll give this a try. Is this at the system level, or does it depend on the application's event handling?
it's at the system level
Posted by: paws on 2026-04-27 11:32:58
It sometimes works but sometimes it either freezes the machine or leads to weirdness later. I only ever use it to get a chance to save and reboot in an orderly fashion.
Posted by: Phipli on 2026-04-27 12:17:19
Yeah, remember the classic Mac OS doesn't have protected memory, so really if your program has crashed you should probably restart anyway, even if you successfully force quit.
Posted by: adespoton on 2026-04-27 14:20:31
If you can't successfully force quit, the solution is to hit the interrupt key (or programmer's key combo, depending on the device), and do:
SM FA700 A9F4
PC FA700
G
First line sets the memory at address FA700 (usually a safe range to overwrite) to A9F4 ("exit to shell" trap).
Second line sets the program counter to that address (telling the computer to process from that memory address next)
Third line runs from the current address, causing the OS to trigger an "exit to shell" event, which SHOULD drop you back into the Finder.

At that point, you want to Special -> Shut Down, as things will be almost guaranteed to be unstable and crash-prone. Gives you the option to cleanly shut down instead of just rebooting though.

Since you're writing your own code, you're probably dropping in and out of the debugger. You can just use that same minibug routine but set the memory at whatever address is safe in your existing stack to A9F4 and run it. Or, you can pre-set an address in your own stack to A9F4, and have a debug handler that points to that address if you get into a nested loop situation beyond a specified depth.
Posted by: chip-64bit on 2026-04-27 14:40:55
If you can't successfully force quit, the solution is to hit the interrupt key (or programmer's key combo, depending on the device), and do:
SM FA700 A9F4
PC FA700
G
First line sets the memory at address FA700 (usually a safe range to overwrite) to A9F4 ("exit to shell" trap).
Second line sets the program counter to that address (telling the computer to process from that memory address next)
Third line runs from the current address, causing the OS to trigger an "exit to shell" event, which SHOULD drop you back into the Finder.

At that point, you want to Special -> Shut Down, as things will be almost guaranteed to be unstable and crash-prone. Gives you the option to cleanly shut down instead of just rebooting though.

Since you're writing your own code, you're probably dropping in and out of the debugger. You can just use that same minibug routine but set the memory at whatever address is safe in your existing stack to A9F4 and run it. Or, you can pre-set an address in your own stack to A9F4, and have a debug handler that points to that address if you get into a nested loop situation beyond a specified depth.
Thank you, I'm a bit afraid to use the interrupt key, because my emulator is not very stable under the built-in debugger, and I still don't know why.
Posted by: chip-64bit on 2026-04-27 14:44:02
Yeah, remember the classic Mac OS doesn't have protected memory, so really if your program has crashed you should probably restart anyway, even if you successfully force quit.
Thank you, because I am not very familiar with how to write UI code, I often encounter infinite loops. I think this shouldn't be a big problem?
Posted by: chip-64bit on 2026-04-27 14:47:05
It sometimes works but sometimes it either freezes the machine or leads to weirdness later. I only ever use it to get a chance to save and reboot in an orderly fashion.
To be honest, this is the first time I have felt how important memory protection is.
Posted by: adespoton on 2026-04-28 09:46:11
Thank you, I'm a bit afraid to use the interrupt key, because my emulator is not very stable under the built-in debugger, and I still don't know why.
In that case, go with my last suggestion, and for your debug code version, keep a loop counter and a pre-populated A9F4 that your exception handler can call.
Posted by: chip-64bit on 2026-04-28 11:52:22
In that case, go with my last suggestion, and for your debug code version, keep a loop counter and a pre-populated A9F4 that your exception handler can call.
Thanks, I’ll do that.
1