What about the float hardware stack, and callbacks ?
In a new application, I use the hardware stack, but avoid
the next schema:
1e 2e ... ... SendMessage ... F+ ( f: probably-bad-value )
^^^^^^^^^^^
Supposing I append now a timer (SetTimer), or a task, what
can I do to avoid erratic problems ?
Is such case, is it a good idea to backup/restore the hardware-stack
in user-variables, at the beginning/end of my callbacks ?
Thanks,
Charles
----- Original Message -----
From: "Rick VanNorman" <rvn_at_forth.com>
To: <sftalk_at_forth.com>
Sent: Friday, November 10, 2000 7:08 PM
Subject: RE: [sftalk] SF Stack
correct.
--rick
*********** REPLY SEPARATOR ***********
On 11/10/2000 at 9:59 AM Mike Ghan wrote:
>So one *could* over/underflow the message loop, but the offending code would
>need to be part of the message loop itself.
>
>Mike
>
>-----Original Message-----
>From: sftalk-admin_at_forth.com [mailto:sftalk-admin_at_forth.com]On Behalf Of
>Rick VanNorman
>
>Mike,
>
>The discussion is really good, because this is complicated. The
>message loop itself runs as the "foreground" task, and the
>callbacks are "interrupts" to it. They are invoked by the
>DispatchMessage routine, but when it executes the callback,
>the result is essentially a new "virtual machine" on which the
>callback runs.
>
>Rick
>
>*********** REPLY SEPARATOR ***********
>
>On 11/10/2000 at 9:32 AM Mike Ghan wrote:
>
>>How does the "classic" windows message loop play into this? It's structure
>>appears to be that of a "traditional" Forth program: BEGIN WHILE REPEAT
>>which repeats until the program quits.
>>
>>Mike
>>
>>>This is exactly correct. In a callback, the stack overflow tolerance is
>>>very large, on the order of 2k cells. Underflow is limited to about 4
>cells.
>>>On each callback entry, a new, empty stack frame is created; on exit the
>>>entire stack frame is discarded and only the top value on the stack is
>>>returned.
_______________________________________________
Sftalk mailing list Sftalk_at_forth.com
Visit Sftalk on the web at http://www.forthinc.com/mailman/listinfo/sftalk
Received on Mon Nov 13 2000 - 06:33:18 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.