Remove inline ASM for /% word.
authorDan White <dan@whiteaudio.com>
Sun, 1 Feb 2015 17:00:40 +0000 (11:00 -0600)
committerDan White <dan@whiteaudio.com>
Sun, 1 Feb 2015 17:00:40 +0000 (11:00 -0600)
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.

msp4th/msp4th.c

index d72a4a165d6a676b02d04cc8de67f1b81372fb01..5684e88ff9774cb56493e7d7b639eb074c7548be 100644 (file)
@@ -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 -- )