+2004-02-03 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/mcs51/gen.c: removed non-standard C nameless struct/union
+
2005-02-04 Slade Rich <slade_rich AT users.sourceforge.net>
* src/pic/gen.c : Fix for bugs #1080519 & #1115662.
2004-02-03 Maarten Brock <sourceforge.brock AT dse.nl>
- * device/include/mcs51/c8051f120.h: added decalrations for sbit port 2,3&4
+ * device/include/mcs51/c8051f120.h: added declarations for sbit port 2,3&4
2005-02-02 Raphael Neider <rneider AT web.de>
static unsigned short rbank = -1;
+#define R0INB _G.bu.bs.r0InB
+#define R1INB _G.bu.bs.r1InB
+#define OPINB _G.bu.bs.OpInB
+#define BINUSE _G.bu.BInUse
+
static struct
{
short r0Pushed;
short r0InB : 2;//2 so we can see it overflow
short r1InB : 2;//2 so we can see it overflow
short OpInB : 2;//2 so we can see it overflow
- } ;
+ } bs;
short BInUse;
- } ;
+ } bu;
short accInUse;
short inLine;
short debugLine;
{
bool pushedB = FALSE;
- if (_G.BInUse)
+ if (BINUSE)
{
emitcode ("push", "b");
// printf("B was in use !\n");
}
else
{
- _G.OpInB++;
+ OPINB++;
}
return pushedB;
}
}
else
{
- _G.OpInB--;
+ OPINB--;
}
}
{
emitcode ("mov", "b,%s",
mcs51_regWithIdx (R0_IDX)->dname);
- _G.r0InB++;
+ R0INB++;
}
else if (!_G.r0Pushed)
{
{
emitcode ("mov", "b,%s",
mcs51_regWithIdx (R1_IDX)->dname);
- _G.r1InB++;
+ R1INB++;
}
else if (!_G.r1Pushed)
{
switch (aop->type)
{
case AOP_R0:
- if (_G.r0InB)
+ if (R0INB)
{
emitcode ("mov", "r0,b");
- _G.r0InB--;
+ R0INB--;
}
else if (_G.r0Pushed)
{
break;
case AOP_R1:
- if (_G.r1InB)
+ if (R1INB)
{
emitcode ("mov", "r1,b");
- _G.r1InB--;
+ R1INB--;
}
if (_G.r1Pushed)
{
switch (aop->type)
{
case AOP_R0:
- if (_G.r0InB)
+ if (R0INB)
{
emitcode ("mov", "r0,b");
}
break;
case AOP_R1:
- if (_G.r1InB)
+ if (R1INB)
{
emitcode ("mov", "r1,b");
}
{
char *l;
//if B in use: push B; mov B,left; mov A,right; clrc; subb A,B; pop B; jnz
- wassertl(!_G.BInUse, "B was in use");
+ wassertl(!BINUSE, "B was in use");
l = aopGet (AOP (left), offset, FALSE, FALSE);
if (strcmp (l, "b"))
emitcode ("mov", "b,%s", l);
break;
default: emitcode ("mov", "c,acc.%d", posbit & 0x07);
break;
- }
+ }
}
// if(left & 2^n)
else
(AOP_TYPE (IC_JTCOND (ic)) == AOP_R1 && _G.r1Pushed))
{
// (MB) what if B is in use???
- wassertl(!_G.BInUse, "B was in use");
+ wassertl(!BINUSE, "B was in use");
emitcode ("mov", "b,%s", l);
l = "b";
}