Re: Euphoria on ARM (and other processors)
- Posted by SDPringle Jan 18, 2010
- 1588 views
If you use the latest svn version you can take the original code like this:
#define push() asm("movl %0,%%ecx; pushl (%%ecx);" : /* no out */ : "r"(last_offset) : "%ecx" ) #define pop() asm( "movl %0,%%ecx; addl (%%ecx),%%esp;" : /* no out */ : "r"(as_offset) : "%ecx" )
And replace it with:
#if ARCH == ix86 #define push() asm("movl %0,%%ecx; pushl (%%ecx);" : /* no out */ : "r"(last_offset) : "%ecx" ) #define pop() asm( "movl %0,%%ecx; addl (%%ecx),%%esp;" : /* no out */ : "r"(as_offset) : "%ecx" ) #else #define push() asm("mov %%r1,%0;push (%%r1);" : /* no out */ : "r"(last_offset) : "%r1" ) #define pop() asm("mov %%r1,%0;add %%r13, 0, %r1;" : /* no out */ : "r"(as_offset) : "%r1" ) #endif
Then push()&pop() will be like the original code when compiled on a PC and it will use the other assembler code for the ARM. You will have to replace my example with code that has been tested. ;)
You can submit a patch to www.rapideuphoria.com which has always worked for me in the past or you could paste your patch into a http://euphoria.pastey.net and post the link here.
Shawn Pringle