Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:38 24 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 : Modular basic

     Page 2 of 2    
Author Message
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 01:44am 04 Oct 2011
Copy link to clipboard 
Print this post

Dinosaur - You just restated my earlier points, but used "USE" rather than modifying the already implemented "MERGE". Am I right?
Micromites and Maximites! - Beginning Maximite
 
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 311
Posted: 01:48am 04 Oct 2011
Copy link to clipboard 
Print this post

Hi All

Yes CircuitGizmos, that is correct.The reason I used "Use" is that was the example shown in the first post. But I am still trying to get clarification if we are talking about compiled modules or .bas code.

Regards

EDIT: After reading all the posts again I admit having overlooked your Merge example being the same as the Use example I made. Vasi's questions about not knowing the line numbering of the module, made me re-state the concept.Edited by Dinosaur 2011-10-05
Regards
Hervey Bay Qld.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 01:56am 04 Oct 2011
Copy link to clipboard 
Print this post

I'm suggesting MERGE "x.bas", 5000 for BASIC source code as it would be easiest to implement and understand.

MERGE with a starting line number has been done in other BASIC dialects. Sometimes as "APPEND" instead of "MERGE" though.

Perhaps binary libraries could be implemented later.


Micromites and Maximites! - Beginning Maximite
 
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 311
Posted: 02:13am 04 Oct 2011
Copy link to clipboard 
Print this post

Hi all

Good, we agree

Regards
Regards
Hervey Bay Qld.
 
Olimex
Senior Member

Joined: 02/10/2011
Location: Bulgaria
Posts: 226
Posted: 07:21am 04 Oct 2011
Copy link to clipboard 
Print this post

MM Basic is interpreter and the code is not compiled anyway, so MERGE is elegant way to include pre-debugged libraries written in Basic

loading binary (assembler or pre-compiled C code) and possibility to call them from Basic is another story which could be implemented in future too for time critical "addon commands" or features, this will unleash completely PIC32 power encapsulated in easy to use Basic interpreter shell
 
Xiongmao

Regular Member

Joined: 25/08/2011
Location: Australia
Posts: 48
Posted: 10:12pm 08 Oct 2011
Copy link to clipboard 
Print this post

There is another benefit of this approach as well. If the existing MM code is re-compiled to be modular, then unused existing functions could be 'unloaded' to free up space for other modules.
E.g. a 'maximite core' running a web interface inside a larger project could run a TCP/IP module in space freed up from not running local VGA.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 10:59pm 08 Oct 2011
Copy link to clipboard 
Print this post

  Xiongmao said   There is another benefit of this approach as well. If the existing MM code is re-compiled to be modular, then unused existing functions could be 'unloaded' to free up space for other modules.
E.g. a 'maximite core' running a web interface inside a larger project could run a TCP/IP module in space freed up from not running local VGA.

I am sorry to rain on your parade but MMBasic will never be modular in this way. To be able to load and unload compiled subsections would require a sophisticated operating environment (read operating system) capable of relocating and relinking modules on the fly. Microsoft Windows and Linux do this but their footprint is very large and writing something like this would be just impracticable.

This is different from loading BASIC modules and renumbering them, there is no problem with that (other than the getting the time to write the code to do it).

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

Newbie

Joined: 29/07/2011
Location: United States
Posts: 38
Posted: 05:00pm 10 Oct 2011
Copy link to clipboard 
Print this post

Hi Geoff,

IMHO if you add a few simple hooks, you can get most of what
is needed/wanted.

Our products do this. IIRC it took not even a dozen hooks to support
most applications.

Big system style is clearly not needed. I was looking at retrobsd to see what they did. I couldn't find any loadable module part? Maybe I missed it or just didn't understand the code. DOS really took off when the DOS technical manual described how to write and link in 'device drivers'. They were simple and sometimes small.

Given that most code is in flash, I haven't yet figured out a 'cute' way to put the hooks into MMBASIC myself? Maybe just a few fields of NOPs within MMBASIC that can be hex patched prior to burning the flash?

Just my humble opinion.

Wiz
 
wizard

Newbie

Joined: 29/07/2011
Location: United States
Posts: 38
Posted: 03:18pm 11 Oct 2011
Copy link to clipboard 
Print this post

Hi Geoff,

I probably should have suggested fields
of 0xffffffff instead of 0x0 since the
erased state of the flash is '1'.

Wiz
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2024