1) The assembly code (prgmEDITLOCK I'm assuming you mean) wasn't incorrect, just copied. Make sure to type everything in correctly, or a MEM reset will happen (its happened to me too!).
2) Stop cursing Thel
3) You could optimize this program to make it smaller in size and faster in speed! Here's how:
Your current code
PROGRAM:RAMLEFT
Clear Entries
ClrHome
Asm(prgmFREERAM
Ans→n //The first "N" in the catalog
n+51→n
Repeat getKey
Output(1,1,"RAM left:
Output(2,1,n
Output(2,8,"kilobytes
End
ClrHome
You can take out the ClearEntries because most times you won't need it unless you have a really large variable in
Ans (In this case you won't). You can also take out the lines "Ans→n" and "n+51→n" because the Asm hex code stores the RAM amount in
Ans. By doing this, you will replace the line "Output(2,1,n" with "Output(2,1,Ans+51" Let's see where our code stands now.
PROGRAM:RAMLEFT
ClrHome
Asm(prgmFREERAM
Repeat getKey
Output(1,1,"RAM left:
Output(2,1,Ans+51
Output(2,8,"kilobytes
End
ClrHome
We can also take out the
Repeat loop because nothing over-the-top is being repeated. You could replace it with a
Pause or take it out entirely. If you choose to use Pause, you'll do:
PROGRAM:RAMLEFT
ClrHome
Asm(prgmFREERAM
Pause "RAM left:
Output(2,1,Ans+51
Output(2,8,"kilobytes
ClrHome
Or if you wanted to, you could combine everything using
Text( or
Disp.
PROGRAM:RAMLEFT
ClrHome
Asm(prgmFREERAM
Disp "RAM left:",Ans+51,"kilobytes
ClrHome
(
Text( follows the same syntax as
Disp)
If the spacing is wrong, you can add or remove spaces as needed. But this is a good program, fully functional. Great job!