Bernd Paysan wrote:
Code start-routine :R 4 SP D) UP mov ' pause arel) jmp end-code
I keep staring at (pass and wake words and I am not quite sure what you
mean by creating a different list in them. Here is what I localized as
useful:
Label tboot :R DI pop SI pop lods BX BX xor ret end-code
Code ^ AX push OP AX mov Next end-code hmacro :ax 0 T&P
\ places n1 through nm in memory starting at address pointed to by addr
\ returns the address of the next cell in memory
: >Task ( n1 .. nm cells addr -- addr2 )
@ over - under >r bounds ?DO I ! cell +LOOP r> ;
: (pass ( n0 ... nm-1 m Taskaddr -- ) rdrop
>r cells r@ user' s0 + >Task
r> r> -rot >r ^ tboot \ --> ip sp op tboot r: task
4 cells r@ user' r0 + >Task
r@ user' TsaveRP + ! r> wake ;
Code start-routine :R 4 SP D) UP mov ' pause rel) jmp end-code
I can figure out what >Task does (added comments). I think in
start-routine you mistyped rel) as arel). However, I am not sure what
needs to be changed in (pass since I am not sure what ^ and tboot do.
Let me try guessing:
: (pass ( n0 ... nm-1 m Taskaddr -- )
rdrop destroys the point of return for (pass?
rdrop
The next line places n0 .. nm-1 onto the data stack of the task
Taskaddr? user' s0 returns the address of s0 of the task Taskaddr
>r cells r@ user' s0 + >Task
The first r> places Taskaddr on the stack, what does the second one puts
there? I guess it is the address of the function that has called
activate or pass, then it must be the one where the task was created
with newtask. Have no idea what ^ and tboot do.
r> r> -rot >r ^ tboot \ --> ip sp op tboot r: task
Now all of the stuff generated by the previous line is placed on the
return stack of the Taskaddr task.
4 cells r@ user' r0 + >Task
The last cell returned by the above >Task is placed in Taskaddr TsaveRP
and the address of the task s passed to wake
r@ user' TsaveRP + ! r> wake ;
Now as I understand wake should be different for my task. It seems
linkTask needs to be different. This is a big problem for me now - it is
in assembly and I can hardly read it to understand what it is doing,
forget about rewriting it :) If you can help with it, please.
Thanks!
--
Sergey
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]