Possible to execute from internal RAM?

Hi all

Just had a thought, is it possible to write values (which are opcodes) to internal RAM then "jump" to that code, execute them and return back?

No, it isn't possible. RAM is an entirely separate address space to program memory.

Indirect jumping is possible, but AVR is Hayward architecture.

mod: Of course Harvard. Stupid auto correct.

sp. "Harvard"

Thanks AWOL.

Pity as it would be nice to be able to make a Xmodem type function where a smallish program could be compiled and "uploaded" to the running Arduino via the serial port. The Arduino stores the program in RAM and then jumps to it, executes it and returns back to some point in the main program.

You can use the Bitlash interpreter to achieve much the same result.

PeterH: You can use the Bitlash interpreter to achieve much the same result.

Thank you PeterH that certainly looks very interesting.