You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Is now a reality! (As of 1v60, or git commit a92ea2e529588c6f86cf268ff227438167052843­)

    addr = process.memory().stackEndAddress;
     0x4770,0xbf00].forEach(function(v,a) { poke16(addr+a*2,v); });
    a = E.nativeCall(addr+1, "long (long)");

    The code above is just copy/pasted out of an object file generated by GCC. It takes a 64 bit int and adds 2 to it.

    The function a that got created can be used just like any normal function:


    So who wants to make a Thumb assembler written in JavaScript? :) Could be a fun project...

    I actually got TCC (the Tiny C compiler) compiled into JavaScript with Emscriptem (so it could have run on the Web IDE), but unfortunately I can't get the code it produces to run on the Cortex M3.


Avatar for Gordon @Gordon started