retroforth/interface/error.retro
crc a147144fde check in current work on error handling device
FossilOrigin-Name: a094776a8890c56a8d3ad05e44e4216acde44d04f9df0b1f781699dbaf77c272
2023-06-27 00:20:12 +00:00

16 lines
377 B
Forth

~~~
:err:set-handler (nn-)
#1234 io:scan-for
dup n:negative? [ drop 'Error:_device_(1234)_not_found s:put nl ] if;
#0 swap io:invoke ;
:err:dsu (-)
reset nl 'ERROR:_DSU:_DATA_STACK_UNDERFLOW s:put nl bye ;
:err:dso (-)
reset nl 'ERROR:_DSO:_DATA_STACK_OVERFLOW s:put nl bye ;
:err:set-defaults
&err:dsu #1 err:set-handler
&err:dso #2 err:set-handler ;
~~~