EasyManua.ls Logo

ST ST7 - Page 207

ST ST7
317 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
207/317
7 - Debugger and PROM Programmer Tutorial for ST72251
Now, at the top of each of the stacks, the routine writes the address of the beginning of each
task, and initializes the variable
Permut to zero. This variable keeps track of the number of the
current task.
07-space
An array of four variables, ImStack1 to ImStack4, are initialized to the address (on a single
byte) of the top of the stack of each task, minus two. The reason for this minus two” is that the
execution does not
go to
the task from the kernel; it actually
returns
to the task. This is per-
formed by a
ret instruction, that expects a return address to be present on the stack even be-
fore the task has been ever started, hence the minus two.
Everything is ready to start multitasking. Now, the stack pointer is set to the contents of
ImStack1, and the
ret instruction that terminates StartTasks is executed.But since the stack
has been reorganized, the execution will not return to the instruction that follows the
Call
StartTasks
, but to the first instruction of the first task.
E000
Add_Task1
Add_Task2
Add_Task3
Add_Task4
Common space:
Start_Task and Yield
programs, sub routines
interrupt routines and
common parts of the tasks
First task
program
Second task
program
Third task
program
Fourth task
program
Little kernel : Program space organization
Interrupt vector
table
FFE0
FFFF

Table of Contents

Related product manuals