![]() |
Forum Index : Microcontroller and PC projects : Native code execution in MM+
Author | Message | ||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
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 KingdomPosts: 4071 |
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. John |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |