Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:31 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RESTORE Woes on a MM+ E100

Author Message
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 12:27am 25 Oct 2023
Copy link to clipboard 
Print this post

Hi,
I have just added some more code to an already large program, and got a plaintive beep towards the end of the download to my MM+ E100.

MEMORY showed no program loaded, and the character count from MMEdit showed 90K characters, exceeding the RAM size of 89KB, assuming 1 character/byte.

I am also assuming that a program is downloaded to RAM before tokenisation into Flash, so it wouldn't ever get downloaded even though the Flash at 96KB is large enough to take it.

Sorry, lots of assumptions - please put me right if they're not true!

I reasoned that if I put some subroutines into the Library, the main program would then be small enough to fit the RAM, and so be downloaded too.
I shifted 6600 characters worth of subs into the Library, and got the main program to download.

Yippee!

Then came a problem - a Library sub needs to access labelled DATA in the main program, and MMBasic errors, saying :-
[LIBRARY] Restore Hdr_Ctrl_List.Lbl
Error : Cannot find label

The label and data is in the main program, and all worked fine before the Library split. I've read the manual, but can't figure out a solution.

All suggestions welcome, with best regards, Paul.

p.s. The program is heavily #REPLACE'd with Disco4now's routine, so little chance to shrink the program much at all.
Nothing so constant as change.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 01:01am 25 Oct 2023
Copy link to clipboard 
Print this post

It sounds as if you have done everything correctly by moving some code to the library.  However, in the library any RESTORE commands operate on the library space only.

The only thing that I can think of is moving some other code that does not read data to the library.  There must be something.

Geoff
Geoff Graham - http://geoffg.net
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6099
Posted: 01:52am 25 Oct 2023
Copy link to clipboard 
Print this post

Can you store the data in a file and read it in as required. Slow but not a problem for a one time read.

Jim
VK7JH
MMedit   MMBasic Help
 
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 11:30am 25 Oct 2023
Copy link to clipboard 
Print this post

Hi Geoff,
Thanks for clarifying the RESTORE command and Library interaction. You are quite right - there are plenty of other subs that I can move - I just happened to choose one that would have a problem.

Must be one of Murphy's laws that describes this perfectly - perhaps "If anything can go wrong it will - and more often than you would think!"

Hi TassyJim,
Thanks for your suggestion. I use the SD card to store Help file info, which works well, and this would relieve Flash of having to store that data. Definitely worth a look.

Thanks too to Grogster and this forum. I added control codes into the Help file text using the same technique as his icons to make bold, or italics etc., and can change the font, text colour, underline, and lines per screen! Makes otherwise dry text more interesting,

With best regards to all, Paul.
Nothing so constant as change.
 
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 02:14pm 25 Oct 2023
Copy link to clipboard 
Print this post

Hi Geoff,
Perhaps the Micromite manual could be clarified with the Library info w.r.t DATA access.

My v5.05.05 version on p.47 describes DATA access from the Library to the main program DATA is possible - but you say not.

With best regards, Paul.
Nothing so constant as change.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 09:11pm 25 Oct 2023
Copy link to clipboard 
Print this post

DATA reads default to reading from the main program space but you needed to use RESTORE which {when used in the library) changes the reads to be from the library space.

So the manual is correct - but this mechanism could be clarified. I will set a ToDo for the next manual update.

Geoff.
Geoff Graham - http://geoffg.net
 
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 11:48pm 25 Oct 2023
Copy link to clipboard 
Print this post

Hi Geoff,
Thanks. I needed to select assorted DATA blocks at random, hence using RESTORE.

I have now chosen other subs I woun't have to edit to put in the Library, and all work well. The Library seems to reserve Flash in 2K blocks, so I juggled subs to get just under a multiple of 2K so as not to loose too much main program space!

With thanks, Paul.
Nothing so constant as change.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024