From: George H. <geo...@us...> - 2007-01-27 10:32:40
|
Update of /cvsroot/win32forth/win32forth-610old/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9902/win32forth-610old/src Modified Files: EXCEPTIO.F Log Message: gah: Modified to use h. rather than . to prevent recursive exceptions when base is accidently set to 0. Index: EXCEPTIO.F =================================================================== RCS file: /cvsroot/win32forth/win32forth-610old/src/EXCEPTIO.F,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EXCEPTIO.F 14 Dec 2004 23:53:57 -0000 1.1 --- EXCEPTIO.F 27 Jan 2007 10:32:37 -0000 1.2 *************** *** 13,26 **** Exception Handling V4.0C ------------------------ ! Exception handling now uses a process wide exception handler to trap all OS generated errors in Win32Forth. The sequence of events is as follows: ! 1. Exception handler set by call to SET-EXCEPT SET-EXCEPT points to a callbnack IN-EXCEPT that does most of the work. ! 2. Code executes, hits some error IN-EXCEPT gets called with 1 parameter. This points to two words: ! DWORD Exception Record DWORD Context Record --- 13,26 ---- Exception Handling V4.0C ------------------------ ! Exception handling now uses a process wide exception handler to trap all OS generated errors in Win32Forth. The sequence of events is as follows: ! 1. Exception handler set by call to SET-EXCEPT SET-EXCEPT points to a callbnack IN-EXCEPT that does most of the work. ! 2. Code executes, hits some error IN-EXCEPT gets called with 1 parameter. This points to two words: ! DWORD Exception Record DWORD Context Record *************** *** 45,49 **** 9. Returns to OS to undertake the recovery. ! Trapping Memory Write Errors ---------------------------- --- 45,49 ---- 9. Returns to OS to undertake the recovery. ! Trapping Memory Write Errors ---------------------------- *************** *** 51,58 **** This code supports RESERVEing memory using VirtualAlloc, without COMMITting it first. ! First, reserve a range of a process's virtual address space. Reserving address space ! does not allocate any physical storage, but it prevents other allocation operations ! from using the specified range. Reserving pages prevents needless consumption of ! physical storage, while allowing a process to reserve a range of its address space into which a dynamic data structure can grow. Reserved but uncommitted memory will cause ACCESS VIOLATIONS if it is addressed. --- 51,58 ---- This code supports RESERVEing memory using VirtualAlloc, without COMMITting it first. ! First, reserve a range of a process's virtual address space. Reserving address space ! does not allocate any physical storage, but it prevents other allocation operations ! from using the specified range. Reserving pages prevents needless consumption of ! physical storage, while allowing a process to reserve a range of its address space into which a dynamic data structure can grow. Reserved but uncommitted memory will cause ACCESS VIOLATIONS if it is addressed. *************** *** 60,79 **** Once the memory is then committed, it is backed by swap pages and is mapped into the virtual address space. Now it can be used (written and read). ! The support provided here allows storage be reserved only. If a block of storage is reserved, and it is then written to, the exception handler traps the error and automatically commits the memory and retries the failing instruction. ! For instance: ! PAGE_NOACCESS MEM_RESERVE 0x400000 0 CALL VirtualAlloc ABS>REL CONSTANT LARGEAREA This reserves but does not consume memory resources. ! 10 LARGEAREA 0x4000 + ! ! This causes an exception, the memory is COMMITed as PAGE_EXECUTE_READWRITE. Only the page (4K) at LARGEAREA 0x4000 + requires swap and memory resources. ! Catching Errors --- 60,79 ---- Once the memory is then committed, it is backed by swap pages and is mapped into the virtual address space. Now it can be used (written and read). ! The support provided here allows storage be reserved only. If a block of storage is reserved, and it is then written to, the exception handler traps the error and automatically commits the memory and retries the failing instruction. ! For instance: ! PAGE_NOACCESS MEM_RESERVE 0x400000 0 CALL VirtualAlloc ABS>REL CONSTANT LARGEAREA This reserves but does not consume memory resources. ! 10 LARGEAREA 0x4000 + ! ! This causes an exception, the memory is COMMITed as PAGE_EXECUTE_READWRITE. Only the page (4K) at LARGEAREA 0x4000 + requires swap and memory resources. ! Catching Errors *************** *** 88,92 **** Here's some sample output: ! 0 @ \ fetch from absolute zero --- 88,92 ---- Here's some sample output: ! 0 @ \ fetch from absolute zero *************** *** 109,113 **** Invoking word CONSOLE-STATUSBAR-INTERPRET loaded from: ...SRC\CONSOLE\CONSOLESTATBAR.F at line: 92 fails at word _INTERPRET loaded from: SRC\FKERNEL.F at line: 4238 ! For TURNKEYed applications, only the registers are shown. --- 109,113 ---- Invoking word CONSOLE-STATUSBAR-INTERPRET loaded from: ...SRC\CONSOLE\CONSOLESTATBAR.F at line: 92 fails at word _INTERPRET loaded from: SRC\FKERNEL.F at line: 4238 ! For TURNKEYed applications, only the registers are shown. *************** *** 139,143 **** : (except-io) ; \ basic forth io ! ' (except-io) is EXCEPT-IO --- 139,143 ---- : (except-io) ; \ basic forth io ! ' (except-io) is EXCEPT-IO *************** *** 260,267 **** : .exname ( addr -- ) \ only available in non-turnkeyed apps ! ?name dup .NAME $.viewinfo drop drop ; ! : except-rstack ( a1 -- ) cr ." Backtracking: " --- 260,267 ---- : .exname ( addr -- ) \ only available in non-turnkeyed apps ! ?name dup .NAME $.viewinfo drop drop ; ! : except-rstack ( a1 -- ) cr ." Backtracking: " *************** *** 270,275 **** if i @ here u< if dup >name nfa-count type ! i @ ! swap >body - cell / 1- ." +" . else h. then --- 270,275 ---- if i @ here u< if dup >name nfa-count type ! i @ ! swap >body - cell / 1- ." +" h. else h. then *************** *** 288,292 **** : .exregs ( n -- ) @ 14 col h.8 ; ! : except-presskey ( -- ) cr ." Press any key to exit..." wait ; --- 288,292 ---- : .exregs ( n -- ) @ 14 col h.8 ; ! : except-presskey ( -- ) cr ." Press any key to exit..." wait ; |