PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space);
PCOI(aop->aopu.pcop)->index = 0;
- DEBUGpic14_emitcode(";"," rname %s, val %d, const = %d",
- sym->rname, 0, PCOI(aop->aopu.pcop)->_const);
+ DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d",
+ __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const);
allocDirReg (IC_LEFT(ic));
PCOI(aop->aopu.pcop)->_const = IS_PTR_CONST(operandType(op));
PCOI(aop->aopu.pcop)->index = val;
- DEBUGpic14_emitcode(";"," rname %s, val %d, const = %d",
- OP_SYMBOL(IC_LEFT(ic))->rname,
+ DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d",
+ __LINE__,OP_SYMBOL(IC_LEFT(ic))->rname,
val, IS_PTR_CONST(operandType(op)));
// DEBUGpic14_emitcode(";","aop type %s",AopType(AOP_TYPE(IC_LEFT(ic))));
if(!aop)
return;
+ DEBUGpic14_emitcode ("; ***","%s %d offset=%d",__FUNCTION__,__LINE__,offset);
+
if ( aop->type == AOP_PCODE ||
aop->type == AOP_LIT )
emitpcode(POC_MOVLW,popGet(aop,offset));
/* hack hack! see if this the FSR. If so don't load W */
if(AOP_TYPE(right) != AOP_ACC) {
+
emitpcode(POC_MOVFW,popGet(AOP(result),0));
emitpcode(POC_MOVWF,popCopyReg(&pc_fsr));
+ if(AOP_SIZE(result) > 1) {
+ emitpcode(POC_BCF, popCopyGPR2Bit(PCOP(&pc_status),PIC_IRP_BIT));
+ emitpcode(POC_BTFSC,newpCodeOpBit(aopGet(AOP(result),1,FALSE,FALSE),0,0));
+ emitpcode(POC_BSF, popCopyGPR2Bit(PCOP(&pc_status),PIC_IRP_BIT));
+
+ }
+
//if(size==2)
//emitpcode(POC_DECF,popCopyReg(&pc_fsr));
//if(size==4) {
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_W | PCC_Z) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_W | PCC_LITERAL), // inCond
(PCC_W | PCC_Z | PCC_C | PCC_DC) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_W | PCC_LITERAL), // inCond
(PCC_W | PCC_Z) // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_W | PCC_Z) // outCond
2, // num ops
1,1, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_BSF,
(PCC_REGISTER | PCC_EXAMINE_PCOP), // inCond
PCC_REGISTER // outCond
2, // num ops
1,1, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_BCF,
(PCC_REGISTER | PCC_EXAMINE_PCOP), // inCond
(PCC_REGISTER | PCC_EXAMINE_PCOP) // outCond
2, // num ops
0,1, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_BTFSS,
(PCC_REGISTER | PCC_EXAMINE_PCOP), // inCond
PCC_EXAMINE_PCOP // outCond
2, // num ops
0,1, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_BTFSC,
(PCC_REGISTER | PCC_EXAMINE_PCOP), // inCond
PCC_EXAMINE_PCOP // outCond
1, // num ops
0,0, // dest, bit instruction
1,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_REGISTER // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_W // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_REGISTER // outCond
0, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_W // outCond
0, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_REGISTER // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_W // outCond
2, // num ops
1,0, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_REGISTER // outCond
2, // num ops
0,0, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_W // outCond
1, // num ops
0,0, // dest, bit instruction
1,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_REGISTER // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_W // outCond
2, // num ops
1,0, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_REGISTER // outCond
2, // num ops
0,0, // dest, bit instruction
1,1, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_W // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_W | PCC_Z) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_W | PCC_LITERAL), // inCond
(PCC_W | PCC_Z) // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
PCC_Z // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_REGISTER, // inCond
(PCC_W | PCC_Z) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_W, // inCond
PCC_REGISTER // outCond
pCodeInstruction pciMOVLW = {
{PC_OPCODE, NULL, NULL, 0, NULL,
- // genericAnalyze,
genericDestruct,
genericPrint},
POC_MOVLW,
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_NONE | PCC_LITERAL), // inCond
PCC_W // outCond
0, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond
0, // num ops
0,0, // dest, bit instruction
1,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond (not true... affects the GIE bit too)
1, // num ops
0,0, // dest, bit instruction
1,0, // branch, skip
+ 1, // literal operand
POC_NOP,
PCC_LITERAL, // inCond
PCC_W // outCond
0, // num ops
0,0, // dest, bit instruction
1,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_NONE // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_C | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z | PCC_C | PCC_DC) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_C | PCC_REGISTER), // inCond
(PCC_W | PCC_Z | PCC_C | PCC_DC) // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_C | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z | PCC_C | PCC_DC) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_C | PCC_REGISTER), // inCond
(PCC_W | PCC_Z | PCC_C | PCC_DC) // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_W | PCC_Z) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_W | PCC_LITERAL), // inCond
(PCC_W | PCC_Z | PCC_C | PCC_DC) // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_REGISTER), // inCond
(PCC_REGISTER) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_REGISTER), // inCond
(PCC_W) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
PCC_NONE, // inCond
PCC_REGISTER // outCond
2, // num ops
1,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_REGISTER | PCC_Z) // outCond
2, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 0, // literal operand
POC_NOP,
(PCC_W | PCC_REGISTER), // inCond
(PCC_W | PCC_Z) // outCond
1, // num ops
0,0, // dest, bit instruction
0,0, // branch, skip
+ 1, // literal operand
POC_NOP,
(PCC_W | PCC_LITERAL), // inCond
(PCC_W | PCC_Z | PCC_C | PCC_DC) // outCond
SAFE_snprintf(&s,&size,"(%s + %d)",
pcop->name,
PCOI(pcop)->index );
- } else
- SAFE_snprintf(&s,&size,"%s",pcop->name);
+ } else {
+ if(PCOI(pcop)->offset)
+ SAFE_snprintf(&s,&size,"(%s >> %d)&0xff",pcop->name, 8*PCOI(pcop)->offset);
+ else
+ SAFE_snprintf(&s,&size,"%s",pcop->name);
+ }
}
return buffer;
}
#endif
- if((reg && REG_BANK(reg)!=cur_bank) ||
- ((PCI(pc)->op == POC_CALL) && (cur_bank != 0) )) {
+ if( ( (reg && REG_BANK(reg)!=cur_bank) ||
+ ((PCI(pc)->op == POC_CALL) && (cur_bank != 0) ) ) &&
+ (!isPCI_LIT(pc)) ){
/* Examine the instruction before this one to make sure it is
* not a skip type instruction */
}
#endif
- if((reg && REG_BANK(reg)!=cur_bank) ||
- ((PCI(pc)->op == POC_CALL) && (cur_bank != 0) )) {
+ if( ( (reg && REG_BANK(reg)!=cur_bank) ||
+ ((PCI(pc)->op == POC_CALL) && (cur_bank != 0) ) ) &&
+ (!isPCI_LIT(pc)) ){
+
/* Examine the instruction before this one to make sure it is
* not a skip type instruction */