From: krishna.myneni@ccreweb.org   
      
   On 4/16/24 02:59, albert@spenarnc.xs4all.nl wrote:   
   > In article ,   
   > Krishna Myneni wrote:   
   >> On 4/15/24 09:09, Anton Ertl wrote:   
   >>> Krishna Myneni writes:   
   >>>> Failure from overflowing the   
   >>>> fpu stack is silent.   
   >>>   
   >>> Reality check:   
   >>>   
   >>> VFX Forth 64 5.43 [build 0199] 2023-11-09 for Linux x64   
   >>> © MicroProcessor Engineering Ltd, 1998-2023   
   >>>   
   >>> 1e 2e 3e 4e 5e 6e 7e ok F:-7   
   >>> 8e ok   
   >>> NDP Stack Fault: NDP SW = 0041   
   >>> NDP Potential Exception: NDP SW = 0041   
   >>>   
   >>> SwiftForth also seems to notice it in some way, but does not report it   
   >>> as an error:   
   >>>   
   >>> SwiftForth x64-Linux 4.0.0-RC87 24-Mar-2024   
   >>> 1e 2e 3e 4e 5e 6e ok   
   >>> f. 6.00000000 ok   
   >>>   
   >>> SwiftForth x64-Linux 4.0.0-RC87 24-Mar-2024   
   >>> 1e 2e 3e 4e 5e 6e 7e ok   
   >>> f.   
   >>> ok   
   >>   
   >> I tried overflowing the fpu stack in kforth32, and no exception is   
   >> raised. Perhaps one needs to configure the fpu to raise an exception.   
   >> Also tried it in C with an assembly procedure. The executable throws no   
   >> exception.   
   >>   
   >> --   
   >> Krishna   
   >>   
   >> == begin fpu-stack-overflow.4th ==   
   >> fpu-stack-overflow.4th   
   >> \ for use with kforth32   
   >>   
   >> include ans-words   
   >> include strings   
   >> include modules   
   >> include syscalls   
   >> include mc   
   >> include asm-x86   
   >>   
   >> code fpu-stack-overflow   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> fld1,   
   >> end-code   
   >>   
   >> fpu-stack-overflow   
   >>   
   >>   
   >> == end fpu-stack-overflow.4th ==   
   >>   
   >> == begin example ==   
   >> $ kforth32   
   >> kForth-32 v 2.4.5 (Build: 2024-03-30)   
   >> Copyright (c) 1998--2023 Krishna Myneni   
   >> Contributions by: dpw gd mu bk abs tn cmb bg dnw   
   >> Provided under the GNU Affero General Public License, v3.0 or later   
   >>   
   >> include fpu-stack-overflow   
   >> ok   
   >> == end example ==   
   >>   
   >>   
   > I tried this on ciforth. It crashes with the 10th item   
   > not the 8th.   
   >   
      
   That may be for some other reason. The following code executes an   
   arbitrary number of FLD1 instructions:   
      
   code fpu-stack-overflow ( n -- -n )   
    0 [ebx] ecx mov, \ set loop count   
    0 # eax mov,   
    DO,   
    fld1,   
    eax dec,   
    LOOP,   
    eax 0 [ebx] mov,   
    0 # eax mov,   
   end-code   
      
   16384 fpu-stack-overflow .   
   \ end of prog   
      
   \ run it   
      
   include clf-code/fpu-stack-overflow   
      
   -16384   
    ok   
      
      
   --   
   Krishna   
   > Groetjes Albert   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|