In article <20220509002344.69e3765a@t530>,
ciforth inherits these vectors from fig-Forth and they are still
usable.
-2 CELLS +ORIGIN is the cold start vector
-1 CELLS +ORIGIN is the warm start vector
If anything untowards happens in a linux executable, you
have a last change to do something, using a "signal handler".
Signals are e.g. ^C interrupt, invalid address etc.
It is a simple address where the executable is restarted, so
a jump.
So you have such code as:
\ Make sure any traps restart Forth at ADDRESS .
: SET-TRAPS 32 1 DO I OVER 0 __NR_signal XOS DROP LOOP DROP ;
\ Still fig tradition: warm and cold starts below origin
: SET-TRAPS-WARM -2 CELLS +ORIGIN SET-TRAPS ;
This doesn't differentiate between traps, it just executes the
word COLD.
If you want something more sophisticated then that, you must
provide code to replace COLD, to take care of specific signal
behaviour. You are wildly into system programming.
In 1980 you were required two perform two diskette changes to reboot and
this was useful. Nowadays you would be more inclined to restart
the Forth from the command line. The usefulness is ca. limited to be
able to type ^C to end an infinite loop.
>
>Jan Coombs
>--
>
Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&
c.xs4all.nl &=n
http://home.hccnet.nl/a.w.m.van.der.horst