Division exception

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I experience division exception in the testsuite.
T{ MIN-2INT LO-2INT NIP DUP NEGATE M*/ -> MIN-2INT }T

x64 machine, gforth-64, hex
0 80000000 c0000000 40000000 m*/ d. 1800000000000000000000000  ok
80000000 c0000000 40000000 */ d.    
*the terminal*:24: error: Stack underflow
80000000 c0000000 40000000 */ >>>d.<<<

x64 machine, gforth-32, hex
0 80000000 c0000000 40000000 m*/ d. -8000000000000000  ok
80000000 c0000000 40000000 */ .  
*the terminal*:2: error: Division by zero
80000000 c0000000 40000000 >>>*/<<< .

x64 machine, Win32forth, hex
0 80000000 c0000000 40000000 m*/ d. -8000000000000000  ok
80000000 c0000000 40000000 */ .  

EXCEPTION 0xC0000095 INT_OVERFLOW
Version: 6.15.04 Build: 4  
Registers:
 Eax:         00000000
 Ebx: TOS     40000000 top of stack
 Ecx:         60000000
 Edx: USER    20000000 user area
 Edi:         00000000
 Esi: IP      0040B0B8 Forth ip
 Esp: SP@     00195F2C stack ptr
 Ebp: RP@     0019FF4C rstack ptr
 Eip: PC      00401CFC machine ip
Backtracking: _INTERPRET+14 CEF830 QUERY-INTERPRET+2 CATCH+E  
Data stack:   0 0 0 195F70  
Primitive     */MOD  loaded from: SRC\KERNEL\FKERNEL.F at line: 1303  
Invoking word _INTERPRET  loaded from: SRC\KERNEL\FKERNEL.F at line: 4859  
fails at word */  loaded from: SRC\KERNEL\FKERNEL.F at line: 1328  

Press any key to exit...
                           ^^
Error(9998): */ Windows exception trapped  

With my 16 bit CHForth, dosemu, both */ and m*/ throw the exception.

On this 64bit machine, only the combination of M*/ and a 64 bit
Forth is successful. 32 bit and 16 bit Forths crash.
*/ always crashes.

Perhaps it's possible to devise another regression test.

groet, Coos

Re: Division exception
On Wed, 10 Oct 2018 18:10:20 +0200, Coos Haak wrote:

Quoted text here. Click to load it
There may be better places to post this, such as to a forth news group or  
by raising a bug against the regression test and/or g-forth and  
Win32forth. After all, this NG isn't exactly a hotbed of Forth hackers: I  
can't remember when I last saw anything about Forth on it.


--  
Martin    | martin at
Gregorie  | gregorie dot org

Re: Division exception
Op Wed, 10 Oct 2018 16:53:02 +0000 (UTC) schreef Martin Gregorie:

Quoted text here. Click to load it

I see, wrong group.

Sorry, Coos

Site Timeline