From: Dan White Date: Sun, 1 Feb 2015 17:00:40 +0000 (-0600) Subject: Remove inline ASM for /% word. X-Git-Tag: cheetah~9 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=d389c075bc9b51199b1887f263ba215419c6e3a7;p=430.git Remove inline ASM for /% word. This was used with the mspgcc in Ubuntu 12.04 LTS, the libc function __divmodhi4 was unnecessarily called twice. The updated mspgcc in Ubuntu 14.04 LTS: "msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)" used from now has a (better?) libc and compilation of the libc. Also, __divmodhi4 is not present anyway in the new libc and therefore throws an error. --- diff --git a/msp4th/msp4th.c b/msp4th/msp4th.c index d72a4a1..5684e88 100644 --- a/msp4th/msp4th.c +++ b/msp4th/msp4th.c @@ -1056,24 +1056,10 @@ void execVM(int16_t opcode) break; case 5: // /% ( a b -- a/b a%b ) -#if defined(MSP430) - /* directly call divmodhi4, gcc calls it twice even though the fn returns - * both values in one call */ - asm("mov 2(%[ms]), r12\n" - "mov 0(%[ms]), r10\n" - "call #__divmodhi4\n" - "mov r12, 2(%[mso])\n" - "mov r14, 0(%[mso])\n" - : [mso] "+r" (mathStackPtr) /* outputs */ - : [ms] "r" (mathStackPtr) /* inputs */ - : /* clobbers */ "r10","r11","r12","r13","r14" - ); -#else i = NOS; j = TOS; NOS = i / j; TOS = i % j; -#endif break; case 6: // . ( a -- )