# call

Definition: | call(atom a)
Description: | Call a machine language routine that starts at address a. This routine must execute a RET instruction #C3 to return control to Phix. The routine should save and restore any registers that it uses.
pwa/p2js: | Not supported
Comments: | You can allocate() a block of memory for the routine and then poke() in the bytes of machine code. You might allocate other blocks of memory for data and parameters that the machine code can operate on. The addresses of these blocks could be poked into the machine code.
Example: | demo\rosetta\Compiler\vm.exw
Implementation: | See builtins\VM\pcfunc.e (an autoinclude) for details of the actual implementation.
See Also: | allocate, free, peek, poke, x86 call, ARM branches