+ } else if(// (AOP_TYPE(IC_LEFT(ic)) == AOP_IMMD) ||
+ (AOP(IC_LEFT(ic))->type == AOP_LIT) &&
+ (AOP_TYPE(IC_RIGHT(ic)) != AOP_ACC)) {
+
+ lit = (unsigned long)floatFromVal(AOP(IC_LEFT(ic))->aopu.aop_lit);
+ DEBUGpic14_emitcode ("; left is lit","line %d result %s, left %s, right %s",__LINE__,
+ AopType(AOP_TYPE(IC_RESULT(ic))),
+ AopType(AOP_TYPE(IC_LEFT(ic))),
+ AopType(AOP_TYPE(IC_RIGHT(ic))));
+
+
+ if( (size == 1) && ((lit & 0xff) == 0) ) {
+ /* res = 0 - right */
+ if (pic14_sameRegs(AOP(IC_RIGHT(ic)), AOP(IC_RESULT(ic))) ) {
+ emitpcode(POC_COMF, popGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+ } else {
+ emitpcode(POC_MOVFW, popGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+ emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+ }
+ goto release;
+ }
+
+ emitpcode(POC_MOVFW, popGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+ emitpcode(POC_SUBLW, popGetLit(lit & 0xff));
+ emitpcode(POC_MOVWF,popGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+
+
+ offset = 1;
+ while(--size) {
+ lit >>= 8;
+
+ if(size == 1) {
+ /* This is the last byte in a multibyte subtraction
+ * There are a couple of tricks we can do by not worrying about
+ * propogating the carry */
+ if(lit == 0xff) {
+ /* 0xff - x == ~x */
+ if(same) {
+ emitpcode(POC_COMF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ emitSKPC;
+ emitpcode(POC_DECF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ } else {
+ emitpcode(POC_COMFW, popGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+ emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ emitSKPC;
+ emitpcode(POC_DECF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ }
+ } else {
+ emitpcode(POC_MOVFW, popGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+ emitSKPC;
+ emitpcode(POC_INCFW, popGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+ emitpcode(POC_SUBLW, popGetLit(lit & 0xff));
+ emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ }
+
+ goto release;
+ }
+
+ if(same) {
+
+ if(lit & 0xff) {
+ emitpcode(POC_MOVLW, popGetLit(lit & 0xff));
+ emitSKPC;
+ emitpcode(POC_MOVLW, popGetLit((lit & 0xff)-1));
+ emitpcode(POC_SUBWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ } else {
+ emitSKPNC;
+ emitpcode(POC_SUBWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+
+ }
+ } else {
+
+ if(lit & 0xff) {
+ emitpcode(POC_MOVLW, popGetLit(lit & 0xff));
+ emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ } else
+ emitpcode(POC_CLRF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+
+ emitpcode(POC_MOVFW, popGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+ emitSKPC;
+ emitpcode(POC_INCFSZW,popGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+ emitpcode(POC_SUBWF, popGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+ }
+ }
+
+