StepperII
Dual Axis Stepper Controller

Built-In Command Line Words

These words reside in the StepperII controller firmware. Every function needed for StepperII application code should be available in Console Commands. However, these functions might be helpful for advanced users.

Miscillaneous

version  // --                display software version
help     // --                display help

Math

Note:
Can't display symbols for subtract (minus sign), multiply (asterisk), or scale (asterisk,forward slash)
+        // x y -- x+y        add
         // x y -- x-y        subtract
         // x y -- x*y        multiply
/        // x y -- x/y        divide
/mod     // x y -- quot rem   divide with rem
         // x * y / z         scale (with long multiply)

RAM Access

c!       // char address --   store data byte at address
c@       // address -- char   read byte from address
!        // int address --    store data int at address
@        // address -- int    read int from address

EEPROM Access

ec!      // char address --   store data byte at eeprom address
ec@      // address -- char   read byte from eeprom address
e!       // int address --    store data int at eeprom address
e@       // address -- int    read int from eeprom address

Interpreter

         // -- address flag   get word info from dictionary
execute  // address flag --   execute word found in dictionary
binary   // --                change number base to 2
decimal  // --                change number base to 10
hex      // --                change number base to 16
Do       // n --              set up a simple loop
I        // -- n              provide decrementing loop count

Console I/O

key      // -- char           get char from console (blocking)
keys     // -- int            get number of chars available from console
emit     // char --           write a character to the console
cr       // --                write \r\n to the console
space    // --                write ' ' to the console
.        // int --            print the number on top of the stack
type     // address --        print the zero-terminated string from the ROM address

Stack Manipulation

         // -- address        get address of stack top
ds       // --                display stack contents
drop     // int --            drop the top stack item
dup      // int -- int int    duplicate the top stack item
swap     // x y -- y x        swap the top two stack items
0=       // int -- flag       test the top stack item for zero

I/O Port Manipulation

bport    // -- address        get address of PORTB
cport    // -- address        get address of PORTC
dport    // -- address        get address of PORTD
dir      // addr -- addr-1    convert PORTX to DDRX
pin      // addr -- addr-2    convert PORTX to PINX
sb       // bit addr --       set bit in register at address
cb       // bit addr --       clear bit in register at address
tb       // bit addr --       toggle bit in register at address
pulse    // bit addr msec --  toggle pulse the bit

Delays

msDelay  // n --              delay for n milliseconds
delay    // n --              delay for n seconds

Dynamic Memory Allocation

malloc   // n -- address      get the address of a block of n bytes
free     // address --        release the memory block at address
erase    // addr n --         write n bytes of zero at addr
fill     // addr n val --     write n bytes of val at addr

Memory Dump

dump     // addr n --         do a hex dump of n bytes at RAM addr
pdump    // addr n --         do a hex dump of n bytes at FLASH addr
edump    // addr n --         do a hex dump of n bytes at EEPROM addr

Compiler

here     // -- addr           get address for top of dictionary
allot    // n --              allocate n bytes in the dictionary
create   // --                create a name header in the dictionary
constant // n --              n constant <name> creates named constant
variable // --                variable <name> creates named int var
forget   // --                forget <name> deletes portion of dictionary
:        // --                begin a new word definition
;        // --                end a colon definition
if       // n --              conditional branch
else     // --                conditional branch target
then     // --                conditional branch target
do       // lim init --       loop from init to lim     
loop     // --                end of do loop, increments loop count
+loop    // n --              end of do loop, adds n to loop count
i        // -- n              get loop index
begin    // --                start begin again loop
again    // n --              loop while n != 0
]        // --                start compiling
[        // --                stop compiling
."       // --                compile a string - use: ." a string"
 All Classes Files Functions Variables Defines