From: wizhippo <wiz...@ho...> - 2004-04-23 14:23:32
|
I'm trying to fix the output. It seams there is a problem with genCast for pic14 here is the code i'm tyring to compile task_PCL[task_No] = (byte) a; // task address low byte I get the folowing code: I highlighted what is wrong ; task_PCL[task_No] = (byte) a; // task address low byte MOVF r0x40,W ;id=304,key=000,flow seq=02d ;; popGet AOP_PCODE (PO_IMMEDIATE) 1401 _task_PCL ADDLW _task_PCL ;id=306,key=001,flow seq=02d ;; 1372 regiser idx = 109 MOVWF r0x43 ;id=308,key=002,flow seq=02d ;; popGet AOP_PCODE (PO_IMMEDIATE) 1401 _task_PCL MOVLW high _task_PCL ;id=310,key=003,flow seq=02d ;; 1372 regiser idx = 110 MOVWF r0x44 ;id=312,key=004,flow seq=02d BTFSC STATUS,0 ;id=313,key=005,flow seq=02d ;<>Start of new flow, seq=0x2e ancestor = 0x2d ;; 1372 regiser idx = 110 INCF r0x44,F ;id=315,key=000,flow seq=02e ;<>Start of new flow, seq=0x2f ancestor = 0x2d ;;ic ;; *** genCast 9484 ;; 881 register type nRegs=2 ;; 881 register type nRegs=1 ;; line = 9492 result AOP_REG=r0x6F, left -=-, right AOP_REG=r0x6B, size = 1 ;; *** genCast 9564 ;; *** genCast 9579 ;; 1372 regiser idx = 107 MOVF r0x41,W ;id=324,key=000,flow seq=02f ;; 1372 regiser idx = 111 BCF STATUS,5 ;id=1352,key=000,flow seq=02f BCF STATUS,6 ;id=1353,key=000,flow seq=02f ; ********************************************** ; where did the INDF come from and why is the register commented out? ; would be good if there was no indf and the movf r0x45 stayed ; ********************************************** MOVWF INDF ;id=340,key=001,flow seq=02f ;;1 MOVWF r0x45 ; ;************************************************* ;ic ;; *** genPointerSet 9003 ;; *** genNearPointerSet 8638 ;; 881 register type nRegs=2 ;; *** genNearPointerSet 8655 ;; 881 register type nRegs=1 ;; line = 8657 result AOP_REG=r0x6D, left -=-, right AOP_REG=r0x6F, size = 2 ;; *** genNearPointerSet 8665 ;; 1372 regiser idx = 109 BANKSEL r0x43 ;id=1354,key=000,flow seq=02f MOVF r0x43,W ;id=336,key=003,flow seq=02f MOVWF FSR ;id=337,key=004,flow seq=02f ;; 1372 regiser idx = 111 ;*************************************** ; again the register is commented out ; ther is a missing MOVWF INDF ;*************************************** ;;101 MOVF r0x45,W ;;ic ;*************************************** when looking at gen.c that produces the above code the genCast function at 9585 has emitpcode(POC_MOVFW, popGet(AOP(right),offset)); emitpcode(POC_MOVWF, popGet(AOP(result),offset)); why is popGet(AOP(result),offset) swapping the destination register for indf? I believe the two errors are related. The additional mowf ind and the missing one. Any ideas where I would look to fix this or what may be the cause? I have been searching but can't figure out why it is doing this. |