4 - Forth Interest Group
4 - Forth Interest Group
4 - Forth Interest Group
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
(Letters, continued fivmpage 6.)<br />
variable BUGFALSE bug !<br />
variable TRACE TRUE trace !<br />
: ( [chrl ) parse<br />
bug @ if<br />
please ' ." - " .S CR '<br />
else 2drop then<br />
; immediate<br />
: snap trace @ bug ! ; immediate<br />
: unsnap FALSE bug ! ; immediate<br />
The comparison ofwhat you say is on the stack with what<br />
is actually there usually identifies the problem very quickly.<br />
You can also trace just to see what's going on.<br />
If you type snap and recompile SQROOT, typing 18 0<br />
sqroot . gives you:<br />
term -1<br />
term 1<br />
term 3<br />
term 5<br />
term 7<br />
term 9<br />
term 11<br />
term 13<br />
term 1 5<br />
term 17<br />
term 1 9<br />
term 2 1<br />
term 23<br />
term 25<br />
13<br />
To avoid too much output in SQRT I bracket the<br />
stack comments I want printed with snap and unsnap.<br />
UNSNAP Total<br />
: sqrt ( radicand -- root )<br />
0 ( radicand root)<br />
0 ADDRESS-UNIT-BITS CELLS 2 -<br />
DO ( X y)<br />
2 *<br />
OVER I RSHIFT ( . . x')<br />
OVER 2* 1+ ( . . x' y')<br />
snap ( . . x' y') unsnap<br />
< NOT IF ( X y)<br />
DUP ( x . y')<br />
2* 1+ I LSHIFT<br />
snap ( x . y') unsnaD<br />
NEGATE +UNDER ( X y)<br />
1+<br />
THEN<br />
-2 +LOOP<br />
NIP ( root)<br />
Procedarnus in pace,<br />
Wil Baden<br />
Costa Mesa, California<br />
Another Vote for natOOF<br />
Dear Marlin,<br />
I really enjoyed the article fromMarkus Dahrn about natOOF<br />
(FD XV/2). I second the comments that were made by Mark<br />
Madno ("Letters," FD XV/3). Mark is a good guy and his<br />
enthusiasm is contagious. I hope that Markus Dahrn makes his<br />
natOOF and other developments available. As Mark said, "I am<br />
ready to pay money for natOOF now. When can I get it?"<br />
Thanks to everyone who supports the <strong>Forth</strong> <strong>Interest</strong><br />
<strong>Group</strong>. You folks have been a real contribution to my life.<br />
Gus Calabrese, President<br />
WFT<br />
Denver, Colorado<br />
control<br />
with 1MI FORTHTM<br />
For Programming Professionals:<br />
an expanding family of compatible, high-<br />
performance, compilers for microcomputers<br />
For Development:<br />
Interactive <strong>Forth</strong>-83 InterpreterICompilers<br />
for MS-DOS, 80386 32-bit protected mode,<br />
and Microsoft WindowsTM<br />
Ed~tor and assembler included<br />
Uses standard operating system files<br />
500 page manual written In plain English<br />
Support for graph~cs, floating point, native code generation<br />
For Applications: <strong>Forth</strong>-83 Metacompiler<br />
Unique table-driven multi-pass <strong>Forth</strong> compiler<br />
Compiles compact ROMable or disk-based applications<br />
Excellent error handling<br />
Produces headerless code, compiles from intermediate states,<br />
and performs conditional compilation<br />
Typing 18 0 sqrt . gives:<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
. . x' y' 180 0 0 1<br />
I<br />
Cross-compiles to 8080, 2-80, 64180, 680x0 family, 80x86 family,<br />
80x96197 family, 8051131 fam~ly, 6303, 6809, 68HC11<br />
No license fee or royalty for compiled applications<br />
Laboratory Microsystems Incorporated<br />
Post Ofice Box 10430, Manna Del Rey, CA 90295<br />
Phone Credit Card Orders to: (310) 306-7412<br />
Fax: (3 10) 301 -0761<br />
<strong>Forth</strong> Dimensions 41 November 1993 December