Is there a way to find the initial value of HIMEM at initial execution after HIMEM has been moved?
Eg:
10 HIMEM=LOMEM+10*1024
20 blah blah
30 HIMEM=what_HIMEM_was_before_line_10
...other than stuffing it in a variable.
5 H%=HIMEM
10 HIMEM=LOMEM+10*1024
20 blah blah
30 HIMEM=H%
which is my current line of thought.
Initial value of HIMEM
Re: Initial value of HIMEM
Using a variable sounds good to me!
You can set the initial value in options...customise, so it must get stored somewhere - maybe as a registry key? I guess you could read that. Probably slower than just storing it as a variable, though.
TBH, this is probably one for Richard - ask at groups.io, if you haven't already (I always check this forum first...)?
Best wishes,
D

You can set the initial value in options...customise, so it must get stored somewhere - maybe as a registry key? I guess you could read that. Probably slower than just storing it as a variable, though.
TBH, this is probably one for Richard - ask at groups.io, if you haven't already (I always check this forum first...)?
Best wishes,
D
-
- Posts: 39
- Joined: Thu 05 Apr 2018, 14:08
Re: Initial value of HIMEM
Answering my own question through sideways thinking...
What's "above" HIMEM? Well, "nothing". But... hmmm... vague memory, BASIC stores something above there. Peruse the manual trying to remember...
Ah! INSTALL. Loads libraries above HIMEM. That rings a bell. Jon Ripley wrote a "list installed library" routine, so there must be a pointer to the libraries above HIMEM.
Interpreter internal variables: !360=start of loaded libraries. Ah ha! So testing confirms !360 is set to HIMEM/HIMEM is set to !360 on startup, and is the "ceiling" that HIMEM should be set to. The equivalent of my various kernel's MEMTOP.
>PRINT ~HIMEM
7B5C00
>PRINT ~!360
7B5C00
>HIMEM=PAGE+32768
>HIMEM=!360
>PRINT ~HIMEM
7B5C00
Bingo. I think that's close enough for the specialised use case I need.
What's "above" HIMEM? Well, "nothing". But... hmmm... vague memory, BASIC stores something above there. Peruse the manual trying to remember...
Ah! INSTALL. Loads libraries above HIMEM. That rings a bell. Jon Ripley wrote a "list installed library" routine, so there must be a pointer to the libraries above HIMEM.
Interpreter internal variables: !360=start of loaded libraries. Ah ha! So testing confirms !360 is set to HIMEM/HIMEM is set to !360 on startup, and is the "ceiling" that HIMEM should be set to. The equivalent of my various kernel's MEMTOP.
>PRINT ~HIMEM
7B5C00
>PRINT ~!360
7B5C00
>HIMEM=PAGE+32768
>HIMEM=!360
>PRINT ~HIMEM
7B5C00
Bingo. I think that's close enough for the specialised use case I need.
Re: Initial value of HIMEM
Presumably that means you shouldn't increase HIMEM after installing libraries!
Checking, yes, the manual says if you do that the libraries will all be removed....

D
Checking, yes, the manual says if you do that the libraries will all be removed....

D