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