retroforth/book/Advanced-Builds
crc 125d76e059 new build options for reduced memory footprint
FossilOrigin-Name: 3840737baf324f7716e539da1c8711f17fec0fbe4926dafdec0cd544a725c3ec
2019-03-26 14:26:06 +00:00

42 lines
1.5 KiB
Text

# Advanced Builds
## Reduced Memory
RETRO can be built for reduced memory targets. This is primarily
intendeded for use with embedded targets, but can be useful on
large machines as well.
To do this, `make` with `CFLAGS` set to `-DMEM1024K`, `-DMEM512K`,
`-DMEM256K`, `-DMEM192K`, `-DMEM128K`' or `-DMEM96K`. These will
target memory sizes as specified per the following table.
| | 1024kB | 512kB | 256kB | 192kB | 128kB | 96kB |
| ------------- | --------- | ------- | ------- | ------- | ------- | ------ |
| Total Bytes | 1,048,579 | 524,288 | 262,144 | 196,608 | 131,072 | 98,304 |
| Image | 968,000 | 384,000 | 192,000 | 126,000 | 96,000 | 72,000 |
| Data Stack | 512 | 512 | 512 | 512 | 512 | 512 |
| Address Stack | 1,024 | 1,024 | 1,024 | 1,024 | 1,024 | 1,024 |
| Remaining | 79,040 | 138,752 | 68,608 | 69,072 | 33,536 | 24,768 |
The remaining memory is available for use by the VM.
## Custom Image
For users of BSD, Linux, macOS, you can customize the image at
build time.
In the top level directory is a `package` directory containing
a file named `list`. You can add files to compile into your
system by adding them to the `list` and rebuilding.
Example:
If you have wanted to include the NumbersWithoutPrefixes.forth
example, add:
~~~
'example/NumbersWithoutPrefixes.forth include
~~~
To the start of the `list` file and then run `make` again. The
newly built `bin/retro` will now include your additions.