Ficl: An Embeddable Extension Language Interpreter

By John Sadler

Dr. Dobb's Journal January 1999

: toggle-led  ( led -- ) 
    1 swap lshift    \ make a bit-mask for the LED
    led-shadow @ xor \ toggle the bit in the shadow reg
    !oreg            \ now update the LED and shadow
;

Example 4: Toggling an LED by index (0..7).

Back to Article


Copyright © 1999, Dr. Dobb's Journal