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 StatesPosts: 1425 |
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: AustraliaPosts: 311 |
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. Regards Hervey Bay Qld. |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
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: AustraliaPosts: 311 |
Hi all Good, we agree Regards Regards Hervey Bay Qld. |
||||
Olimex Senior Member Joined: 02/10/2011 Location: BulgariaPosts: 226 |
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: AustraliaPosts: 48 |
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: AustraliaPosts: 3194 |
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 StatesPosts: 38 |
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 StatesPosts: 38 |
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 |