embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

Re: TARGET .ALLOCATION

From: Bulgrien, Dennis <Dennis.Bulgrien_at_TripointGlobal.com>
Date: Thu, 9 Dec 2004 09:23:49 -0600

Here it is a little better, with corrections to file locations; the number
is still less than that reported by .ALLOCATION :

______________
app.f:

...
INTERPRETER
: SECTION-USED ( -- n ) \ The amount of space used in the
current section
  HERE LIMITS DROP -
;

TARGET
DEFER /SECTION-USED
VARIABLE SECTION-USED-CDATA

: MAIN ( -- )
  /SECTION-USED
  SECTION-USED-CDATA ? ." CDATA used"
;
...
: GREET ( -- ) ...

______________
build.f:

...
INCLUDE KERNEL
CR .ALLOCATION

: (/SECTION-USED) ( -- )
  [ SAVE-SECTIONS ]
  [ CDATA SECTION-USED ] LITERAL SECTION-USED-CDATA !
  [ RESTORE-SECTIONS ] \ IDATA needed for IS below
;
' (/SECTION-USED) IS /SECTION-USED

INTERPRETER
SAVE-CODE TARGET.BIN
...

-----Original Message-----
From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
Of Bulgrien, Dennis
Sent: Tuesday, December 07, 2004 14:21

How can the amount of memory used in a given section (i.e. that displayed by
.ALLOCATION on an INCLUDE BUILD (F8)) be determined for run-time use?
...
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Thu Dec 09 2004 - 07:24:18 PST

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:50 PST