fitting_20programs_20in_20the_20demo_20version
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
fitting_20programs_20in_20the_20demo_20version [2018/03/31 13:19] – external edit 127.0.0.1 | fitting_20programs_20in_20the_20demo_20version [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
==== Raising HIMEM ==== | ==== Raising HIMEM ==== | ||
\\ If your program (plus its heap and stack space) requires more than the 16K available, but it doesn' | \\ If your program (plus its heap and stack space) requires more than the 16K available, but it doesn' | ||
+ | <code bb4w> | ||
IF HIMEM< | IF HIMEM< | ||
+ | </ | ||
If you need some space above HIMEM, but less than the 8K provided by default, you can still raise HIMEM but to a lesser extent. For example if you need to INSTALL the **FNUSING** library, which requires less than 2K (including the 256 byte overhead), then you can raise HIMEM as follows:\\ \\ | If you need some space above HIMEM, but less than the 8K provided by default, you can still raise HIMEM but to a lesser extent. For example if you need to INSTALL the **FNUSING** library, which requires less than 2K (including the 256 byte overhead), then you can raise HIMEM as follows:\\ \\ | ||
+ | <code bb4w> | ||
IF HIMEM< | IF HIMEM< | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
+ | </ | ||
\\ | \\ | ||
==== Allocating memory from Windows ==== | ==== Allocating memory from Windows ==== | ||
\\ If your program uses large arrays or blocks of data consider allocating the memory using the Windows API rather than from the heap. For example suppose you need a 10K block of data, which you would normally allocate from the heap as follows:\\ \\ | \\ If your program uses large arrays or blocks of data consider allocating the memory using the Windows API rather than from the heap. For example suppose you need a 10K block of data, which you would normally allocate from the heap as follows:\\ \\ | ||
+ | <code bb4w> | ||
DIM block% 10240-1 | DIM block% 10240-1 | ||
+ | </ | ||
If there is insufficient room to do this with the demo version you can alternatively allocate the memory from Windows as follows:\\ \\ | If there is insufficient room to do this with the demo version you can alternatively allocate the memory from Windows as follows:\\ \\ | ||
+ | <code bb4w> | ||
SYS " | SYS " | ||
+ | </ | ||
Remember that you must explicitly free memory allocated this way when you have finished with it:\\ \\ | Remember that you must explicitly free memory allocated this way when you have finished with it:\\ \\ | ||
+ | <code bb4w> | ||
SYS " | SYS " | ||
+ | </ | ||
If you want to declare an array, but there is insufficient room on the heap, you can use the method described in the article [[/ | If you want to declare an array, but there is insufficient room on the heap, you can use the method described in the article [[/ | ||
+ | <code bb4w> | ||
DIM array%(1000) | DIM array%(1000) | ||
+ | </ | ||
If there is insufficient room to do this with the demo version you can allocate the memory from Windows as follows:\\ \\ | If there is insufficient room to do this with the demo version you can allocate the memory from Windows as follows:\\ \\ | ||
+ | <code bb4w> | ||
PROCdim1d(array%(), | PROCdim1d(array%(), | ||
+ | </ | ||
\\ | \\ | ||
==== Other techniques ==== | ==== Other techniques ==== | ||
\\ Using short variable/ | \\ Using short variable/ |
fitting_20programs_20in_20the_20demo_20version.1522502362.txt.gz · Last modified: 2024/01/05 00:17 (external edit)