forth stepper

A Forth interpreter that advances one step at a time: one token of the outer interpreter, or one compiled instruction of the inner one. It opens paused inside 10 4 cc. Breakpoints are the small buttons beside each word in the dictionary panel.

Examples

URL parameters:

parameter value effect
ex an id below loads that program, paused at the first token
run 1 runs it on arrival
debug 1 exposes window.__forthStepper for tests
id example what it shows
counting-change Counting change the default — recursion through the return stack
return-stack Return stack >r parks, r@ peeks, r> restores
loop-counter Loop counter do…loop keeps i on the return stack
float-stack Float stack .s can't see it — f.s can
stack-shuffles Stack shuffles rot / -rot / 2swap on the data stack
pairs-in-memory Pairs in memory cons = two cells; car=@ cdr=cell+ @
factorial Factorial if…else…then and recurse
fibonacci Fibonacci a pair walked along by do…loop
gcd GCD begin…while…repeat, Euclid's loop
countdown Countdown begin…until, the test at the bottom
variables-and-constants Variables and constants variable is an address, constant a value
values Values value reads like a constant; to changes it
array-in-data-space Array in data space create…allot, then cells + to index
execution-tokens Execution tokens ' finds a word; execute runs it
number-base Number base hex and decimal change how numbers read and print
redefinition Redefinition old callers keep the old word
fizzbuzz FizzBuzz nested if…else, mod, ." strings, early exit
collatz Collatz begin…while…repeat with an if inside
fast-exponentiation Fast exponentiation SICP 1.2.4: square the half power when n is even
star-triangle Star triangle emit, cr and spaces draw with characters
counting-by-steps Counting by steps +loop up by 2, and down by 2 to the limit
marker-and-see Marker and see forget definitions; decompile a word
return-stack-discipline Return-stack discipline every >r needs an r> before EXIT
error-recovery Error recovery Run stops at the error; Run again goes on to the next line