Using CRUNCH to remove…

The pico mite has a 328 kB limit. At last count my master flight tool sat at 300 kB.

I upgraded the great circle routine to a WGS – 84 oblate spheroid system. That raised the master flight tool to 315 kB.

And then upgraded the waypoint plotting routine from sphere to oblate sphereoid also raising the routine to 340 kB.

At 340 kB the routine when called from the SD card displayed “not enough memory“ message.

The full routine of 340 kB contains roughly 25 to 40 kB worth of comments and blank spaces for readability.

I understand that I can use something like Tera Term and the MM basic “crunch” command to remove the 25 to 40 kB thus reducing the program down to a manageable 320 to 300 kB which will then load.

I will keep the original master.BAS routine with the full comments and spaces as I modify two different versions, but will now use the “crunch” to load it onto the picocalc.

The question is, has anybody here used the “crunch” command to reduce the size of the.BAS routine by removing the blank spaces and comment sections?

If so what success have you had.

Number two is there a way to increase the 328 kB restriction on the picocalc. Also if I converted these routines to python with that reduce the memory size? That is, is Python more efficient than MM basic?

Hope there are suggestions.

I will be using new data sync micro USB cables on Tuesday and the “crunch” MM basic command and will let you know how much memory that saved.

I’m currently using a Pico 2H and RTC chip. The picocalc is fully up-to-date with the latest UF2 files and keyboard file.

Cheers Geoff

You can have up to 300KB in library routines separate from your BASIC program space.
Modularize your program and put functions and subs in a library. The library will survive resets but you’d be wise to save the routines on drive B, just in case.

2 Likes

The aviation BAS file is 300 kilobytes in size. By adding the Vicenty WGS – 84 routine routines it goes up to 340 kB which will not load from the SD card.

I have the 300 kB and the 340 kB.BAS files created and stored on my laptop a separate SD card as well as the SD card I’m using the picocalc.

The 300 kB up to 315 kB aviation program loads and runs. When the routine hits 328 kB it will not load due to not enough memory.

I think I’m missing something from your explanation.

Are you saying that I can draw upon the library on the SD card running a route program on the a drive. When a menu is selected the computer searches the SD card or B Dr. as it is called for the appropriate routine.

Similar to the HP 41 CX calling extended memory when required?

Thanks for your response Tom

PS, the routine is approximately 13,000 lines at 300 kB and 15,000 lines of 340 kB

I see what I can do now, thanks Tom.

I create avmenu.bas which contains all the menus that call from the library the routines required.

So I split my current 340 kB 15,000 line routine into two separate chunks. The executable file which calls and represented by menus, the actual files residing in the library which automatically crunches the code.