* src/pic16/gen.c (genInline): fixed bug #896482 with inline assembly
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 16 Feb 2004 02:22:49 +0000 (02:22 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 16 Feb 2004 02:22:49 +0000 (02:22 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3199 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic16/gen.c

index 7831e6a459ca1f542091ca227e7a305863a49f2c..2189e4963f6f88652a60bcb1b04261ac33dce540 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-16 Vangelis Rokas <vrokas AT otenet.gr>
+
+       * src/pic16/gen.c (genInline): fixed bug #896482 with inline assembly
+
 2004-02-15 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
 
        * src/mcs51/ralloc.c (packRegsForAssign, reassignAliasedSym): fixed
index a92822ec246793a43800ede72161447bab99ca4f..e0cde477cbe746caf41159ebb9779806b7e5e2bf 100644 (file)
@@ -6335,45 +6335,47 @@ static void genXor (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genInline (iCode *ic)
 {
-    char *buffer, *bp, *bp1;
+  char *buffer, *bp, *bp1;
     
-    DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-
-    _G.inLine += (!options.asmpeep);
+       DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
+       _G.inLine += (!options.asmpeep);
 
-    buffer = bp = bp1 = Safe_calloc(1, strlen(IC_INLINE(ic))+1);
-    strcpy(buffer,IC_INLINE(ic));
+       buffer = bp = bp1 = Safe_calloc(1, strlen(IC_INLINE(ic))+1);
+       strcpy(buffer,IC_INLINE(ic));
 
-    /* emit each line as a code */
-    while (*bp) {
-        if (*bp == '\n') {
-            *bp++ = '\0';
+       /* emit each line as a code */
+       while (*bp) {
+               if (*bp == '\n') {
+                       *bp++ = '\0';
+                       
+                       if(*bp1)
+#if 0
+                               pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL));
+#else
+                               pic16_addpCode2pBlock(pb, pic16_AssembleLine(bp1, 1));
+#endif
+                       bp1 = bp;
+               } else {
+                       if (*bp == ':') {
+                               bp++;
+                               *bp = '\0';
+                               bp++;
+                               pic16_emitcode(bp1,"");
+                               bp1 = bp;
+                       } else
+                               bp++;
+               }
+       }
 
-           if(*bp1)
+       if ((bp1 != bp) && *bp1)
 #if 0
                pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL));
 #else
-               pic16_addpCode2pBlock(pb, pic16_AssembleLine(bp1, 0));
+               pic16_addpCode2pBlock(pb, pic16_AssembleLine(bp1, 1));
 #endif
-                                       // inline directly, no process
-            bp1 = bp;
-        } else {
-            if (*bp == ':') {
-                bp++;
-                *bp = '\0';
-                bp++;
-                pic16_emitcode(bp1,"");
-                bp1 = bp;
-            } else
-                bp++;
-        }
-    }
-    if ((bp1 != bp) && *bp1)
-      pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL));              //pic16_AssembleLine(bp1, 0));
-
-    Safe_free(buffer);
 
-    _G.inLine -= (!options.asmpeep);
+       Safe_free(buffer);
+       _G.inLine -= (!options.asmpeep);
 }
 
 /*-----------------------------------------------------------------*/