Skip to content
Enoch edited this page Sep 15, 2016 · 16 revisions

Welcome to the AmForth-Shadow wiki!

Our master site is NO LONGER http://amforth.sourceforge.net/

10/30/2014 Bad News:

The Shadow May Have To Disengage From Its Body :-(

Thanks, Enoch.

Moving on

AmForth-Shadow development continues and we are interested in peer review (and pull requests). However, on Sourceforge amforth-devel mailing list we seem to have become a "persona non grata", with our anouncements being rejected by the moderator though we adhere to professional conduct! 😠

So, in the alternative let's try through this wiki to draw attention to our latest work. See more in https://github.com/wexi/amforth-shadow/blob/master/amforth-shadow.org

Flash programming, faster and safer

lib/flash.frt

Page optimized flash programming for faster compilation and extended erase/write cycles durability.

lib/t-create.frt

Fast numeric tables compiler.

Keeping your text output "mite-safe"

\ This module (★) protects .{ enclosed text .} output from breaking up
\ by like output from other soft ISRs. Install on start-up by: {mite}
\ (★) Name hint: { e { mit } } and keep your texts mite-proof :)

Lazy man locals implementation (aka three Greek locals)

Examine core/words/greek.asm – a limited yet fast locals implementation. Learn by example:

: div (2) α β / ;
: div (2) \1 \2 / ; \ alternative names for typing convenience
4 2 div . 2  ok

Using the shell (tools/amforth-shell.py) the traditional syntax:

: div { numerator denominator -- quotient } numerator denominator / ;

would be converted to the above form. However, note that outside this "div" definition you cannot use these names of convenience!

Locals are tasks and soft-interrupts safe!

Note:

  1. There can be up to 3 locals, their initial value is undefined. The locals – α, α β or α β γ – are loaded from stack via the words (1), (2) or (3), respectively. This should be the defined word first action. Upon return to the calling word the values of the calling word locals are restored. Local values can be used by called words if not reloaded.

  2. "to" is not implemented. Instead, geek ( x -- ) pushes x through the locals, that is, x → α → β → γ.

Forward reference resolution

Marking forward reference calls with ellipsis, e.g. … my-last-word and … ['] my-last-word execute, enables the shell through the new #forward / #resolve directives to list / complete the Flash code. Unresolved forward reference calls would cause a system restart with the location of the offending call available in α.