Difference: CmsisRtos (22 vs. 23)

Revision 232021-01-22 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 317 to 317
 

Forth Multi-Tasking

Added:
>
>

Terminal Task

User Variables

One of a set of variables provided by Forth, whose values are unique for each task. The defining word user behaves in the same way as variable. The difference is that it reserves space in user (data) space rather than normal data space. In a Forth system that has a multi-tasker, each task has its own set of user variables.

user   ( n "name" -- )         Define a user variable at offset n in the user area
+user  ( n1 n2 n3 "name" -- )  Define a user variable at offset n1 in the user area, and increment the offset 
                               by the size n2 to give a new offset n3.
#user  (  -- n )               Return the number of bytes currently allocated in a user area. 
his    ( addr1 n -- addr2 )    Given a task address addr1 and user variable offset n, returns the address of 
                               the referenced user variable in that task's user area. 

Predefined user variables

base
hook-emit
hook-key
hook-emit?
hook_key?

R0 (R-zero) is the 16-bit address of the bottom of the return stack, which must be in common RAM. R0 is used by ABORT to initialize the S register, which is the return stack pointer. The first value on the stack is stored at the two bytes below R0, and the stack grows downward in memory. After R0 is modified, the new value takes effect after the next ABORT or warm restart.

S0 (S-zero) is the 16-bit address of the bottom of the data stack, which must be in common RAM. S0 is used by ABORT to initialize the Y register, which is the data stack pointer. The first value on the stack is stored at the two bytes below S0, and the stack grows downward in memory. After S0 is modified, the new value takes effect after the next ABORT or warm restart.

 A multi-tasking wordset for Standard Forth, Andrew Haley http://www.complang.tuwien.ac.at/anton/euroforth/ef17/papers/haley-slides.pdf
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback