I don't know if it is valid, but it seems to work for me -
To figure how much free RAM I have, I create a dummy aray variable and compile.
dummy var byte (1000)
If there is no compile error, I figure I have at least 1000 bytes of free memory. I delete the line and go on.
I use MCLoader often in my programs. It occupies some space in high memory. I used to find that I would compile a program and get no errors, only to find that when I actually loaded the code in the part (that already had MCLoader in it), I got an over-run error. I solved that problem by including the following lines at the very end of my program -
Code:
ASM
ORG 0x1fcee ; a few bytes below MCLoader when used in a 128K part
nop
ENDASM
You can put any address you want after the ORG statement. If your program gets bigger than that, you will get a compile error. I have found this technique to be useful in lots of ways.
Bookmarks