if (rlen)
{
- // emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(rlen));
- AccLsh (8 - rlen);
+ emitcode ("anl", "a,#0x%02x", ((unsigned char) -1) >> (8-rlen));
aopPut (AOP (result), "a", offset++, isOperandVolatile (result, FALSE));
}
while (rsize--)
aopPut (AOP (result), zero, offset++, isOperandVolatile (result, FALSE));
}
- return;
}
/* it exactly fits a byte then */
if (SPEC_BLEN (etype) <= 8)
{
+ unsigned char mask = ((unsigned char) (0xFF << (blen + bstr)) |
+ (unsigned char) (0xFF >> (8 - bstr)));
shCount = SPEC_BSTR (etype);
/* shift left acc */
if (SPEC_BLEN (etype) < 8)
{ /* if smaller than a byte */
+ emitcode ("anl", "a,#0x%02x", (~mask) & 0xff);
switch (p_type)
{
break;
}
- emitcode ("anl", "a,#0x%02x", (unsigned char)
- ((unsigned char) (0xFF << (blen + bstr)) |
- (unsigned char) (0xFF >> (8 - bstr))));
+ emitcode ("anl", "a,#0x%02x", mask);
emitcode ("orl", "a,b");
if (p_type == GPOINTER)
emitcode ("pop", "b");
/* last last was not complete */
if (rLen)
{
+ emitcode ("anl", "a,#0x%02x",
+ (~(((unsigned char) -1 << rLen) & 0xff)) &0xff);
+
/* save the byte & read byte */
switch (p_type)
{
aopOp (right, ic, FALSE);
aopOp (result, ic, FALSE);
- /* if the result is a bit */
- if (IS_BITVAR(OP_SYMBOL(result)->type))
+ /* if the result is a bit (and not a bitfield) */
+ if (AOP_TYPE (result) == AOP_CRY)
{
/* if the right size is a literal then
we know what the value is */
goto release;
}
+
/* if they are the same size : or less */
if (AOP_SIZE (result) <= AOP_SIZE (right))
{