From: George H. <geo...@us...> - 2011-08-10 16:56:01
|
Update of /cvsroot/win32forth/win32forth/src/kernel In directory vz-cvs-4.sog:/tmp/cvs-serv27955/kernel Modified Files: fkernel.f Log Message: Added bye to shut properly on error, plus more additions to kernel for task-status Index: fkernel.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/fkernel.f,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** fkernel.f 21 Jul 2011 14:29:59 -0000 1.76 --- fkernel.f 10 Aug 2011 16:55:58 -0000 1.77 *************** *** 1980,1983 **** --- 1980,1986 ---- \ ** not be changed in a task unless locked or you know what you're doing. + \ *P User Variables with a negative offset are designed for system use and so are not normally + \ ** referenced in applications. + VARIABLE NEXT-USER \ offset of next defineable user variable *************** *** 1994,2018 **** -3 CELLS ( init offset so TCB is 0 ) ( order IS important ) ! DUP USER TASK-STATUS CELL+ ( 32 bits for miscellaneous purposes. ) ! DUP USER RP0 CELL+ ( initial return stack pointer ) ! DUP USER SP0 CELL+ ( initial data stack pointer ) ! DUP USER TCB CELL+ ( task control block ) ! DUP ( *1 ) ( absolute min user area ) ! DUP USER &EXREC CELL+ ( for exception handling ) ! DUP USER &EXCEPT CELL+ ( for exception handling ) ! DUP USER HANDLER CELL+ ( throw frame ) ! DUP USER LP CELL+ ( local variable pointer ) ! DUP USER OP CELL+ ( object pointer ) ! DUP USER BASE CELL+ ( numeric radix ) ! DUP | USER RLLEN CELL+ ( read line length, used in file i/o see read-line ) ! DUP | USER RLNEOF CELL+ ( read line not eof, used in file i/o see read-line ) ! DUP USER HLD CELL+ ( numeric output pointer ) ! 80 CHARS ALIGNED + ( numeric output formatting buffer ) ! DUP USER PAD CELL+ ( extra ) ! MAXSTRING CHARS ALIGNED + ( user string buffer ) ! DUP NEXT-USER ! ( save top user variable offset in NEXT-USER ) ! ( *2 ) OVER - CONSTANT USEREXTRA ( add to USERMIN if you are going to do I/O ) ! ( *1 ) 3 CELLS + CONSTANT USERMIN ( absolute min user area ) ! TCB RP0 - CONSTANT USEROFFS ( user offset, 2 cells ) \ -------------------- System Variables ------------------------------------- --- 1997,2039 ---- -3 CELLS ( init offset so TCB is 0 ) ( order IS important ) ! DUP | USER TASK-STATUS CELL+ ( 32 bits for miscellaneous purposes. The lower 24 are reserved for the system) ! DUP USER RP0 CELL+ ( initial return stack pointer ) ! DUP USER SP0 CELL+ ( initial data stack pointer ) ! DUP USER TCB CELL+ ( task control block ) ! DUP ( *1 ) ( absolute min user area ) ! DUP USER &EXREC CELL+ ( for exception handling ) ! DUP USER &EXCEPT CELL+ ( for exception handling ) ! DUP USER HANDLER CELL+ ( throw frame ) ! DUP USER LP CELL+ ( local variable pointer ) ! DUP USER OP CELL+ ( object pointer ) ! DUP USER BASE CELL+ ( numeric radix ) ! DUP | USER RLLEN CELL+ ( read line length, used in file i/o see read-line ) ! DUP | USER RLNEOF CELL+ ( read line not eof, used in file i/o see read-line ) ! DUP USER HLD CELL+ ( numeric output pointer ) ! 80 CHARS ALIGNED + ( numeric output formatting buffer ) ! DUP USER PAD CELL+ ( extra ) ! MAXSTRING CHARS ALIGNED + ( user string buffer ) ! DUP NEXT-USER ! ( save top user variable offset in NEXT-USER ) ! ( *2 ) OVER - CONSTANT USEREXTRA ( add to USERMIN if you are going to do I/O ) ! ( *1 ) 3 CELLS + CONSTANT USERMIN ( absolute min user area ) ! TCB TASK-STATUS - CONSTANT USEROFFS ( user offset, 3 cells ) ! ! : Task-Set ( u -- ) ! Task-Status @ or Task-Status ! ; ! ! : Task-Clear ( u -- ) ! Invert Task-Status @ and Task-Status ! ; ! ! : Task-Flip ( u -- ) ! Task-Status @ xor Task-Status ! ; ! ! : Task-Status? ( -- f ) ! Task-Status or 0 <> ; ! ! 1 | Constant Main-Task ! 2 Constant Assync-Task ! ! : Main? ( -- f ) ! Main-Task Task-Status? ; \ -------------------- System Variables ------------------------------------- *************** *** 5709,5712 **** --- 5730,5735 ---- then + Main-Task Task-Set \ set to identify main task + spcs spcs-max blank \ fill spaces buffer *************** *** 5768,5771 **** --- 5791,5795 ---- mov SP0 [UP] , esp \ save SP0 mov BASE [UP] , dword # 10 \ default base to decimal + mov Task-Status [UP] , dword # 0 \ default Task-Status is all bits off xor edi, edi \ edi is constant 0 |