- wassertl(!aopGetUsesAcc(leftOp, offset), "accumulator clash");
- MOVA (aopGet(rightOp, offset, FALSE, TRUE));
- if (offset == 0) {
- emitcode( "setb", "c");
+ if (aopGetUsesAcc(leftOp, offset)) {
+ bool pushedB;
+
+ MOVA (aopGet (rightOp, offset, FALSE, FALSE));
+ pushedB = pushB ();
+ emitcode ("mov", "b,a");
+ if (offset == 0)
+ CLRC;
+ MOVA (aopGet (leftOp, offset, FALSE, FALSE));
+ emitcode ("subb", "a,b");
+ popB (pushedB);
+ } else {
+ wassertl(!aopGetUsesAcc(leftOp, offset), "accumulator clash");
+ MOVA (aopGet(rightOp, offset, FALSE, TRUE));
+ if (offset == 0) {
+ emitcode( "setb", "c");
+ }
+ emitcode("subb", "a,%s", aopGet(leftOp, offset, FALSE, TRUE));
+ emitcode("cpl", "a");