Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:47 17 Sep 2025 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 : Native code execution in MM+

Author Message
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 10:31pm 08 Jan 2016
Copy link to clipboard 
Print this post

I have been thinking to ask about this for some time... In a similar way to the C functions, what stops a program written in C and compiled with MPLab to a HEX file, to be loaded in the RAM and executed from within the MM+ environment? Imagine how cool would that be, especially for a computing system, such as what I am working on at the moment
http://rittle.org

--------------
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4071
Posted: 03:34am 09 Jan 2016
Copy link to clipboard 
Print this post

Should work.

There will "just" be some typical development problems (address map, passing pointers, not corrupting MMBasic if you plan to use it after the C, etc etc).

If you do want to keep using MMBasic after your C then maybe put the hex (converted to binary) into an array/string (or array of strings) so the RAM is allocated for you and MMBasic will manage it, then call a small CFunction which then calls the C in the array/string.

JohnEdited by JohnS 2016-01-10
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3303
Posted: 04:53pm 09 Jan 2016
Copy link to clipboard 
Print this post

In the early days I experimented with executing code residing in RAM, which is a feature of the PIC32 architecture. It turned out to not be as easy as it seems requiring custom linker scripts, etc so I used the current CFunction mechanism which works just the same,
Geoff Graham - http://geoffg.net
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025