Store word value.
Stack: ( n adr -- )
Availability: target and host
Defined in file(s): _memory.forth:34 and forth.py
Tests two numbers for unequality.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:268 and forth.py
Start a comment and read to its end (``)``).
There is a special comment ( > text... ) which is recognized by the documentation tool. All these type of comments are collected and assigned to the next declaration.
Availability: host
Defined in file(s): forth.py
Add two 16 bit values.
Stack: ( n n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:105 and forth.py
Subtract two 16 bit values.
Stack: ( n n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:112 and forth.py
Divide two numbers on the stack.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): __init__.forth:15 and forth.py
Test if number equals zero.
Stack: ( x -- b )
Availability: target and host
Defined in file(s): _builtins.forth:277 and forth.py
Test if number is positive.
Stack: ( x -- b )
Availability: target and host
Defined in file(s): _builtins.forth:285 and forth.py
Increment value on stack by one.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): __init__.forth:19 and _msp430_lowlevel.forth:101 and forth.py
Decrement value on stack by one.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): __init__.forth:20 and _msp430_lowlevel.forth:120 and forth.py
Multiply by two [arithmetic left shift].
Stack: ( n -- n*2 )
Availability: target and host
Defined in file(s): _builtins.forth:148 and forth.py
Increment value on stack by two.
Stack: ( n -- n )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:107
Decrement value on stack by two.
Stack: ( n -- n )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:126
Divide by two [arithmetic right shift].
Stack: ( n -- n/2 )
Availability: target and host
Defined in file(s): _builtins.forth:154 and forth.py
Drop two items from the stack.
Stack: ( n n -- )
Availability: target and host
Defined in file(s): __init__.forth:9 and _msp430_lowlevel.forth:138
Increment value on stack by four.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): __init__.forth:21 and _msp430_lowlevel.forth:113 and forth.py
Decrement value on stack by four.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): __init__.forth:22 and _msp430_lowlevel.forth:132 and forth.py
Begin defining a function. Example: : ADD-ONE 1 + ;
Availability: host
Defined in file(s): forth.py
Compare two numbers.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:219 and forth.py
Compare two numbers.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:235 and forth.py
Tests two numbers for equality.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:260 and forth.py
Tests two numbers for equality.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:251 and forth.py
Compare two numbers.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:227 and forth.py
Compare two numbers.
Stack: ( x y -- b )
Availability: target and host
Defined in file(s): _builtins.forth:243 and forth.py
Move x to the return stack.
Stack: ( x -- )
Availability: target
Defined in file(s): _builtins.forth:83
? Fetches the integer at an address and prints it.
Stack: ( addr -- )
Availability: target and host
Defined in file(s): __init__.forth:212
Fetch word value.
Stack: ( adr -- n )
Availability: target and host
Defined in file(s): _memory.forth:27 and forth.py
Move word from memory to memory, 16 bit.
Stack: ( src-adr dst-adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:181
Terminate program and restart from the beginning. The implementation is is also providing the ‘main’ entry point.
Availability: target
Defined in file(s): core.forth:15
Bitwise AND.
Stack: ( n n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:120 and forth.py
Helper to write a call in assembler. Example:
CODE PUTCHAR ( u --
ASM-TOS->R15
ASM-CALL putchar
ASM-NEXT
END-CODE
Availability: target and host
Defined in file(s): _asm_snippets.forth:60
Emit assembler for DROP. Example:
CODE DROP-DEMO ( n --
ASM-DROP
ASM-NEXT
END-CODE
Availability: target and host
Defined in file(s): _asm_snippets.forth:32
Emit assembler for NEXT.
Availability: target and host
Defined in file(s): _asm_snippets.forth:23
Emit assembler to push R15 on stack.
Availability: target and host
Defined in file(s): _asm_snippets.forth:41
Emit assembler to pop top of stack to register R14.
Availability: target and host
Defined in file(s): _asm_snippets.forth:38
Emit assembler to pop top of stack to register R15.
Availability: target and host
Defined in file(s): _asm_snippets.forth:35
Emit assembler to pop top of stack to register W.
Availability: target and host
Defined in file(s): _asm_snippets.forth:44
Emit assembler to push register W on stack.
Availability: target and host
Defined in file(s): _asm_snippets.forth:47
Example: BEGIN loop-part condition UNTIL
Availability: target and host
Defined in file(s): __init__.forth:136
BL [BLank] is a standard FORTH word for space.
Availability: target and host
Defined in file(s): __init__.forth:28
Relative jump within a thread.
Availability: target and host
Defined in file(s): _builtins.forth:22 and forth.py
Realtive jump within a thread. But only jump if value on stack is false.
Availability: target and host
Defined in file(s): _builtins.forth:28 and forth.py
Emit the backspace character.
Availability: target and host
Defined in file(s): _asm_snippets.forth:11
Move byte from memory to memory, 8 bit.
Stack: ( src-adr dst-adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:173
(some value on the stack
CASE
test1 OF ... ENDOF
test2 OF ... ENDOF
testn OF ... ENDOF
... (default case
ENDCASE
Availability: target and host
Defined in file(s): __init__.forth:299
Begin defining a native code function. CODE words are executed on the host to get cross compiled. Therefore they have to output assembler code for the target. Example:
( > Increment value on stack by one. )
CODE 1+ ( n -- n )
." \t inc 0(SP) \n "
ASM-NEXT
END-CODE
There is a number of supporting functions for outputting assembler. E.g. ASM-NEXT, ASM-DROP, ASM-TOS->R15, ASM-R15->TOS, ASM-TOS->W, ASM-W->TOS
Note that the NEXT instruction is not automatically inserted and must be added manually (see ASM-NEXT in example above).
Availability: host
Defined in file(s): forth.py
Declare a constant. Assign next word to value from stack. Example: 0 CONSTANT NULL
Availability: host
Defined in file(s): forth.py
CR prints a carriage return.
Availability: target and host
Defined in file(s): __init__.forth:31
Create a frame, typically used for variables.
Availability: host
Defined in file(s): forth.py
Bit clear operation, 8 bit. Example: BIT0 P1OUT CRESET
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:17
Output cross compiled version of function. Example:: CROSS-COMPILE DROP
Availability: host
Defined in file(s): forth.py
Generate init code for forth runtime and core words.
Availability: target and host
Defined in file(s): core.forth:47
Compile all the words that are used by other compiled words but are not yet translated. While compiling words, new words can be found which are then also compiled.
Availability: host
Defined in file(s): forth.py
Output section with variables (values in RAM).
Availability: host
Defined in file(s): forth.py
Bit set operation, 8 bit. Example: BIT0 P1OUT CSET
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:26
Bit test operation, 8 bit. Example: BIT0 P1IN CTESTBIT IF 1 THEN 0 ENDIF
Stack: ( mask adr -- bool )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:44
Bit toggle operation, 8 bit. Example: BIT0 P1OUT CTOGGLE
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:35
Emit the text for a define.
Availability: target and host
Defined in file(s): _asm_snippets.forth:20
Simple busy-wait type delay. 3 cycles/loop. Example: 20 DELAY
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:149
Mark word as used so that it is included in cross compilation. Useful when using other words within CODE definitions.
Availability: host
Defined in file(s): forth.py
Disable interrupts.
Stack: ( -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:202
Entering an interrupt handler. For internal use only.
Availability: target
Defined in file(s): _interrupts.forth:36
Internal helper to execute a thread of forth instructions.
Availability: target
Defined in file(s): core.forth:24
Remove value from top of stack.
Stack: ( x -- )
Availability: target and host
Defined in file(s): _builtins.forth:42 and forth.py
Duplicate value on top of stack.
Stack: ( x -- x x )
Availability: target and host
Defined in file(s): _builtins.forth:48 and forth.py
Enable interrupts.
Stack: ( -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:196
End definition of a native code function. See CODE.
Availability: host
Defined in file(s): forth.py
End definition of a native code function. See INTERRUPT for example.
Availability: host
Defined in file(s): forth.py
Enter low-power mode LPM0.
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:208
Enter low-power mode LPM1.
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:214
Enter low-power mode LMP2.
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:220
Enter low-power mode LPM3.
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:226
Enter low-power mode LPM4.
Stack: ( n -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:232
Restore state at exit of interrupt handler. For internal use only.
Stack: ( R: int-sys -- )
Availability: target
Defined in file(s): _interrupts.forth:52
Emit the hash character.
Availability: target and host
Defined in file(s): _asm_snippets.forth:17
Generate a header in the assembler file
Stack: ( str -- )
Availability: target and host
Defined in file(s): _helpers.forth:16
Examples:
Availability: target and host
Defined in file(s): __init__.forth:100
Tag current function definition as immediate. This means that it is executed even during compilation.
Availability: host
Defined in file(s): forth.py
Include and execute definitions from an other file. Example: INCLUDE helper.forth
Availability: host
Defined in file(s): forth.py
Begin defining an interrupt function. Example:
PORT1_VECTOR INTERRUPT handler_name
WAKEUP
0 P1IFG C!
END-INTERRUPT
Words defined with INTERRUPT must not be called from user code.
Availability: host
Defined in file(s): forth.py
Bitwise invert.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:141 and forth.py
Emit the line feed character.
Availability: target and host
Defined in file(s): _asm_snippets.forth:14
Generate a simple line for headers
Stack: ( -- )
Availability: target and host
Defined in file(s): _helpers.forth:11
Put a literal [next element within thread] on the stack.
Availability: target and host
Defined in file(s): _builtins.forth:16 and forth.py
Logical left shift by u bits.
Stack: ( n u -- n*2^u )
Availability: target and host
Defined in file(s): _builtins.forth:161 and forth.py
NEGATE leaves the negative of a number on the stack.
Availability: target and host
Defined in file(s): __init__.forth:37
NOP - waste some small amount of CPU time.
Stack: ( -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:190
Boolean invert.
Stack: ( b -- b )
Availability: target and host
Defined in file(s): __init__.forth:42 and _builtins.forth:185 and forth.py
Bitwise OR.
Stack: ( n n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:127 and forth.py
Push a copy of the second element on the stack.
Stack: ( y x -- y x y )
Availability: target and host
Defined in file(s): _builtins.forth:56 and forth.py
Push a copy of the N’th element.
Stack: ( n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:64 and forth.py
Move x from the return stack to the data stack.
Stack: ( -- x )
Availability: target
Defined in file(s): _builtins.forth:90
Copy x from the return stack to the data stack.
Stack: ( -- x )
Availability: target
Defined in file(s): _builtins.forth:96
Select RAM as target for following CREATE calls.
Availability: host
Defined in file(s): forth.py
Call currently defined word. This is used to write recursive functions.
Availability: host
Defined in file(s): forth.py
Bit clear operation, 16 bit. Example: CCIE TA0CCTL1 RESET
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:61
Select ROM/Flash as target for following CREATE calls.
Availability: host
Defined in file(s): forth.py
Logical right shift by u bits.
Stack: ( n u -- n/2^u )
Availability: target and host
Defined in file(s): _builtins.forth:171 and forth.py
Bit set operation, 16 bit. Example: CCIE TA0CCTL1 SET
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:69
Sign extend an 8 bit value on stack to 16 bits.
Stack: ( n -- n )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:167
Write given number of spaces. Example:: 20 SPACES.
Stack: ( n -- )
Availability: target and host
Defined in file(s): __init__.forth:199
Exchange the two topmost values on the stack.
Stack: ( y x -- x y )
Availability: target and host
Defined in file(s): _builtins.forth:73 and forth.py
Swap high/low byte.
Stack: ( n -- n )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:161
Bit test operation, 16 bit. Example: CCIFG TA0CCTL1 TESTBIT IF 1 ELSE 0 ENDIF
Stack: ( mask adr -- bool )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:85
Bit toggle operation, 16 bit. Example: CCIE TA0CCTL1 TOGGLE
Stack: ( n adr -- )
Availability: target
Defined in file(s): _msp430_lowlevel.forth:77
UNLESS is the same as IF but the test is reversed.
Availability: target and host
Defined in file(s): __init__.forth:187
Allocate a variable. Creates space in RAM and a value getter function.
Example:
0 VALUE X
X \ -> puts 0 on stack
5 X TO
X \ -> puts 5 on stack
Availability: host
Defined in file(s): forth.py
Allocate a variable. Creates space in RAM and an address getter function.
Availability: host
Defined in file(s): forth.py
Patch the saved status register so that LPM modes are exit after the interrupt handler is finished.
Only allowed directly in INTERRUPT definition. Not in called functions.
May be called multiple times.
Stack: ( R: int-sys -- int-sys )
Availability: target
Defined in file(s): _interrupts.forth:75
Example: BEGIN condition WHILE loop-part REPEAT
Availability: target and host
Defined in file(s): __init__.forth:162
c a b WITHIN returns true if a <= c and c < b or define without ifs: OVER - >R - R> U<
Availability: target and host
Defined in file(s): __init__.forth:216
Read next word from the source and put it on the stack.
Availability: host
Defined in file(s): forth.py
Bitwise XOR.
Stack: ( n n -- n )
Availability: target and host
Defined in file(s): _builtins.forth:134 and forth.py
Erase memory area.
Stack: ( adr u -- )
Availability: target
Defined in file(s): _builtins.forth:296
Get next word, look it up and add it to the current frame (not executing immediate functions).
Availability: host
Defined in file(s): forth.py
Internal helper. Providing several labels to be called from assembler:
Availability: target
Defined in file(s): _builtins.forth:203
internal helper for ."
Stack: ( -- )
Availability: target
Defined in file(s): _builtins.forth:308