git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3199
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+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
2004-02-15 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
* src/mcs51/ralloc.c (packRegsForAssign, reassignAliasedSym): fixed
/*-----------------------------------------------------------------*/
static void genInline (iCode *ic)
{
/*-----------------------------------------------------------------*/
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 != bp) && *bp1)
#if 0
pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL));
#else
#if 0
pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL));
#else
- pic16_addpCode2pBlock(pb, pic16_AssembleLine(bp1, 0));
+ pic16_addpCode2pBlock(pb, pic16_AssembleLine(bp1, 1));
- // 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);
}
/*-----------------------------------------------------------------*/
}
/*-----------------------------------------------------------------*/