Closed ellerh closed 7 years ago
I'm trying to inch this forward.
The SwiftForth distribution file lilb/samples/win32/serial.f
says:
quit is necessary in both cases to reset the catch frame which maintains the default personality for restoring on throws.
So supposedly, the system maintains a top-level CATCH
which changes the personality when an exception is thrown. I haven't found any documentation on this.
The options would be:
CATCH
which overrides the system CATCH
.The first one may be a good idea anyway, to have more control over what happens when there are exceptions.
Find out where the default personality is stored, and change that.
Here's an interesting observation about QUIT:
SwiftForth i386-Linux 3.6.3 29-Jun-2016
'personality @ . 134554011 ok
include swiftforth.fth ok
'personality @ . 134756820 ok
quit 'personality @ . 134756820 ok
abort
'personality @ . 134756820 ok
Maybe QUIT also overwrites the default personality.
Disassembling QUIT reveals a call to /INTERPRET. My guess is that this initializes something important. I tried it out with 6b74225. We will see how it works.
SwiftForth seems to reset the device personality on errors: