- if (AOP_TYPE(right)==AOP_REG && AOP_TYPE(left)==AOP_ACC) {
- emitcode ("orl", "a,%s",
- aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
- } else {
- MOVA (aopGet (right, offset, FALSE, FALSE, NULL));
- emitcode ("orl", "a,%s",
- aopGet (left, offset, FALSE, FALSE, DP2_RESULT_REG));
+ if ((AOP_TYPE(right)==AOP_REG || IS_AOP_PREG(right) || AOP_TYPE(right)==AOP_DIR)
+ && AOP_TYPE(left)==AOP_ACC)
+ {
+ if (offset)
+ emitcode("mov", "a,b");
+ emitcode ("orl", "a,%s", aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
+ }
+ else if (AOP_TYPE(left)==AOP_ACC)
+ {
+ if (!offset)
+ {
+ bool pushedB = pushB ();
+ emitcode("mov", "b,a");
+ MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
+ emitcode("orl", "a,b");
+ popB (pushedB);
+ }
+ else
+ {
+ MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
+ emitcode("orl", "a,b");
+ }
+ }
+ else if (aopGetUsesAcc (left, offset) && aopGetUsesAcc (right, offset))
+ {
+ MOVB (aopGet (left, offset, FALSE, FALSE, NULL));
+ MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
+ emitcode ("orl", "a,b");
+ }
+ else if (aopGetUsesAcc (left, offset))
+ {
+ MOVA (aopGet (left, offset, FALSE, FALSE, NULL));
+ emitcode ("orl", "a,%s", aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG));
+ }
+ else
+ {
+ MOVA (aopGet (right, offset, FALSE, FALSE, NULL));
+ emitcode ("orl", "a,%s", aopGet (left, offset, FALSE, FALSE, DP2_RESULT_REG));