- if(size >= 1) {
- int l = lit & 0xff;
- int h = (lit>>8) & 0xff;
- int optimized=0;
-
- /* Check special cases for integers */
- switch(lit & 0xffff) {
- case 0x0000:
- emitpcode(POC_MOVFW,popGet(AOP(left),offset,FALSE,FALSE));
- emitpcode(POC_IORFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- //pic14_emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- //pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- genSkip(ifx,'z');
- optimized++;
- break;
- case 0x0001:
- emitpcode(POC_DECFW,popGet(AOP(left),offset,FALSE,FALSE));
- emitpcode(POC_IORFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- pic14_emitcode("decf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- genSkip(ifx,'z');
- optimized++;
- break;
- case 0x0100:
- emitpcode(POC_DECFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- emitpcode(POC_IORFW,popGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("decf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- genSkip(ifx,'z');
- optimized++;
- break;
- case 0x00ff:
- emitpcode(POC_INCFW,popGet(AOP(left),offset,FALSE,FALSE));
- emitpcode(POC_IORFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- pic14_emitcode("incf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- genSkip(ifx,'z');
- optimized++;
- break;
- case 0xff00:
- emitpcode(POC_INCFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- emitpcode(POC_IORFW,popGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("incf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- genSkip(ifx,'z');
- optimized++;
- break;
- default:
- if(h == 0) {
- emitpcode(POC_MOVFW,popGet(AOP(left),offset,FALSE,FALSE));
- emitpcode(POC_XORLW,popGetLit(l));
- emitpcode(POC_IORFW,popGet(AOP(left),offset+1,FALSE,FALSE));
-
- pic14_emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("xorlw","0x%x",l);
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- optimized++;
- genSkip(ifx,'z');
- } else if (l == 0) {
- emitpcode(POC_MOVFW,popGet(AOP(left),offset+1,FALSE,FALSE));
- emitpcode(POC_XORLW,popGetLit(h));
- emitpcode(POC_IORFW,popGet(AOP(left),offset,FALSE,FALSE));
-
- pic14_emitcode("movf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
- pic14_emitcode("xorlw","0x%x",h);
- pic14_emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- optimized++;
- genSkip(ifx,'z');
- } else {
- emitpcode(POC_MOVFW,popGet(AOP(left),offset,FALSE,FALSE));
- emitpcode(POC_XORLW,popGetLit(l));
- emitpcode(POC_MOVLW,popGetLit(h));
- emitSKPNZ;
- emitpcode(POC_XORFW,popGet(AOP(left),offset+1,FALSE,FALSE));
-/*
- pic14_emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
- pic14_emitcode("xorlw","0x%x",l);
- pic14_emitcode("movlw","0x%x",h);
- emitSKPZ;
- pic14_emitcode("xorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-*/
- optimized++;
- genSkip(ifx,'z');
- }