Update of /cvsroot/win32forth/win32forth-stc/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20652
Modified Files:
dis486.f imageman.f
Log Message:
arm: support dual code areas in system and application
Index: dis486.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth-stc/src/dis486.f,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dis486.f 30 Sep 2006 23:22:26 -0000 1.3
--- dis486.f 4 Oct 2006 10:27:22 -0000 1.4
***************
*** 29,33 ****
: code>name ( addr -- nfa | 0 )
! dup code-origin cdp between 0= if
drop 0 exit \ it's zero if not in code section
then
--- 29,34 ----
: code>name ( addr -- nfa | 0 )
! dup cdp cell+ 2@ swap between 0= >r \ origin + highest addr for section
! dup kdp cell+ 2@ swap between 0= r> and if
drop 0 exit \ it's zero if not in code section
then
Index: imageman.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth-stc/src/imageman.f,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** imageman.f 23 Sep 2006 06:00:17 -0000 1.2
--- imageman.f 4 Oct 2006 10:27:22 -0000 1.3
***************
*** 740,743 ****
--- 740,759 ----
;
+ : area-len ( n m -- n ) 2@ swap - ; \ length of the section
+ : app-len ( -- n ) adp area-len ;
+ : sys-len ( -- n ) sdp area-len ;
+ : code-len ( -- n ) cdp area-len ;
+ : kode-len ( -- n ) kdp area-len ;
+
+ : PTABL ( -- )
+ cr ." -------" tab ." ---------" tab ." ------" tab ." -------"
+ ;
+
+ : PORIG ( n -- )
+ tab IMAGE-ORIGIN + 8 H.R ." h" ;
+
+ : PSIZE ( n -- )
+ tab 7 .r ;
+
PREVIOUS DEFINITIONS ALSO VIMAGE
***************
*** 836,849 ****
\ ---------------- In memory image handling ---------------------
- : PTABL ( -- )
- cr ." -------" tab ." ---------" tab ." ------" tab ." -------"
- ;
-
- : PORIG ( n -- )
- tab IMAGE-ORIGIN + 8 H.R ." h" ;
-
- : PSIZE ( n -- )
- tab 7 .r ;
-
: IMAGE-STATS ( -- ) \ image statistics
tab-size 10 to tab-size
--- 852,855 ----
***************
*** 882,890 ****
0 0 \ not saving sys header, set zero
ELSE
! KODE-HERE KODE-ORIGIN - \ else current sys/header size
! SYS-HERE SYS-ORIGIN - \ else current sys/header size
THEN
! APP-HERE APP-ORIGIN - \ current app size
! CODE-HERE CODE-ORIGIN - \ current code size
4DUP \ move to actuals
TO IMAGE-CACTUAL
--- 888,896 ----
0 0 \ not saving sys header, set zero
ELSE
! kode-len \ else current sys/header size
! sys-len \ else current sys/header size
THEN
! app-len \ current app size
! code-len \ current code size
4DUP \ move to actuals
TO IMAGE-CACTUAL
***************
*** 893,901 ****
TO IMAGE-kACTUAL
4DUP + + + MALLOC TO IMAGE-PTR \ allocate buffer
!
! code-ORIGIN IMAGE-PTR ROT 2DUP + >R CMOVE \ move the app part, save next addr
! APP-ORIGIN R> ROT 2DUP + >R CMOVE \ move the code part, save next addr
! SYS-ORIGIN R> ROT 2DUP + >R CMOVE \ move the code part, save next addr
! KODE-ORIGIN R> ROT CMOVE \ move the system part (could be zero)
IMAGE-PTR DUP TO IMAGE-CODEPTR \ odd due to way built (app is at front)
--- 899,907 ----
TO IMAGE-kACTUAL
4DUP + + + MALLOC TO IMAGE-PTR \ allocate buffer
! \ origin of section is at xdp cell+ @
! cdp cell+ @ IMAGE-PTR ROT 2DUP + >R CMOVE \ move the app part, save next addr
! adp cell+ @ R> ROT 2DUP + >R CMOVE \ move the code part, save next addr
! sdp cell+ @ R> ROT 2DUP + >R CMOVE \ move the code part, save next addr
! kdp cell+ @ R> ROT CMOVE \ move the system part (could be zero)
IMAGE-PTR DUP TO IMAGE-CODEPTR \ odd due to way built (app is at front)
|