* the accumulator, we must explicitly write
* it back after the decrement.
*/
- emitcode ("dec", "%s",
- aopGet(AOP(IC_RESULT(ic)), 0, FALSE, FALSE, FALSE));
- aopPut(AOP(IC_RESULT(ic)), "acc", 0);
+ char *rByte = aopGet(AOP(IC_RESULT(ic)), 0, FALSE, FALSE, TRUE);
+
+ if (strcmp(rByte, "a"))
+ {
+ /* Something is hopelessly wrong */
+ fprintf(stderr, "*** warning: internal error at %s:%d\n",
+ __FILE__, __LINE__);
+ /* We can just give up; the generated code will be inefficient,
+ * but what the hey.
+ */
+ freeAsmop (IC_RESULT (ic), NULL, ic, TRUE);
+ return 0;
+ }
+ emitcode ("dec", "%s", rByte);
+ aopPut(AOP(IC_RESULT(ic)), rByte, 0);
emitcode ("jnz", "%05d$", lbl->key + 100);
}
else if (IS_AOP_PREG (IC_RESULT (ic)))