var ASM_BASE=process.memory().stackEndAddress;
var ASM_BASE1=ASM_BASE+1/*thumb*/;
[0x4807,0xf000,0xf80d,0xb401,0x4806,0xf000,0xf809,0xb401,0xbc01,0xbc02,0x222b,0xf000,0xf803,0xb401,0xbc01,0x4770,0x62,0x0,0x1,0x0].forEach(function(v) { poke16((ASM_BASE+=2)-2,v); });
var a = E.nativeCall(ASM_BASE1, "JsVar (JsVar)")
It still needs a lot of work - like getting the function pointers for jsvNewFromInteger, and also being aware of which variables are parameters/local, but actually it's very promising indeed.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
If the first statement is a string saying "compiled", it'll have a go at it. It's pretty basic :)
I got a bit carried away... If you now do:
it's compiled to:
which is then assembled to:
It still needs a lot of work - like getting the function pointers for
jsvNewFromInteger
, and also being aware of which variables are parameters/local, but actually it's very promising indeed.