File:  [gforth] / gforth / ec / Attic / mirrored.fs
Revision 1.1: download - view: text, annotated - select for diffs
Sat May 2 21:34:06 1998 UTC (25 years, 11 months ago) by pazsan
Branches: MAIN
CVS tags: HEAD
Mega-Patch; added directories

    1: \ mirror.fs mirrors ram in rom and copies back at startup
    2: 
    3: 0 [IF]
    4: 
    5: For the romable feature:
    6: 
    7: We need to save the ram area (there might be initialized variables,
    8: and code-fields...) into rom and copy it back at system startup.
    9: 
   10: [THEN]
   11: 
   12: \ save ram area
   13: 
   14: unlock >CROSS
   15: 
   16: : saveram
   17:   mirror-link 
   18:   BEGIN @ dup WHILE
   19: 	>r r@ >rstart @ r@ >rdp @ over - tuck
   20: 	2dup X , X , X here swap tcmove
   21: 	X allot X align
   22: 
   23: >rom
   24: unlock sramdp @ lock		constant ram-start
   25: unlock ramdp @ sramdp @ - lock	constant ram-len
   26: variable ram-origin
   27: ram-start ram-origin ram-len unlock tcmove lock 
   28: ram-len allot align
   29: >auto
   30: 
   31: : mirrorram
   32:   ram-origin ram-start ram-len cmove ;
   33: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>