home .. forth .. colorforth mail list archive ..

[ColorForth] how does ColorForth multitasking ?


The relevant part of COLOR.ASM is this:

Gods equ 28000h*4 ; 0A0000h
Godd equ Gods-750*4
mains equ Godd-1500*4
maind equ mains-750*4
ALIGN 4
    me dd offset God
screen dd 0 ; logo

ROUND: call unPAUSE
God     dd 0 ; Gods-2*4
    call unPAUSE
main    dd 0 ; mains-2*4
    jmp  ROUND

PAUSE: DUP_
    push ESI
    mov  EAX, me
    mov  [EAX], ESP
    add  EAX, 4
    jmp  EAX

unPAUSE: pop  EAX
    mov  ESP, [EAX]
    mov  me, EAX
    pop  ESI
    DROP
    ret

I've probably got this wrong (after just a minute or so of looking), but it
looks like ROUND is the top-level "scheduler loop".  PAUSE and unPAUSE take
care of saving and restoring the stack pointers.

-- Kris


--- Andreas Klimas <klimas@xxxxxx> wrote:
> MOwens4166@xxxxxxx wrote:
> > 
> > andreas,
> > which colorforth are you using: chuck moore's or terry lovall's '4word'?
> 
> I'm using terry's patch (c4-800x600-p2bd-02.zip) because the
> original ColorForth didn't work on my Dell notbook. but this
> is not the point, I think.
> 
> 
> I have to add some informations about my intention.
> 
> I'm very interested in ColorForth and the way Mr. Chuck Moore solves
> problems. I have read (hopefully all) the subscriptions from Mr. Jeff
> Fox
> about the videos Mr. Moore gaves, but I'm still missing the way Mr.
> Moore is
> thinking about multitaksing in a single processor. to be able to read
> the ColorForth assembly program (kernel) I begun to study
> the i386+ assembly language to get a clue but since i386+ assembly
> isn't that easy ... I might get help.
> 
> I know about a quite simple way of doing multitasking without the must
> of changing stack pointers which seems appropriate for stack machines.
> if the maintask calls PAUSE the scheduler simply calls the background
> task which must have a small execution time and returns via EXIT (don't
> call PAUSE itself). so this background task must left the stacks
> unchanged.
> might an explicite scheduler isn't needed any more because it could
> be the word PAUSE. this is my thinking how ColorForth could behave
> but I would aks for sure.
> 
> 
> many thanks
> 
> Andreas
> ------------------------
> 
> To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
> unsubscribe ColorForth
> as the first and only line within the message body
> Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
> Main ColorForth site   -   http://www.colorforth.com
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com