From: SourceForge.net <no...@so...> - 2005-07-21 17:54:41
|
Bugs item #939042, was opened at 2004-04-21 03:45 Message generated for change (Settings changed) made by tecodev You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=939042&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic14 target Group: unreproducable >Status: Closed Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: constant assignment problem Initial Comment: when assigning a constan to a value, w is being moved into the memory address at the value of the constant. byte task_delay[MAX_TASKS]; for (current_task_No=0; current_task_No<MAX_TASKS; current_task_No++) task_delay[current_task_No] = 100; produces the following MOVF r0x25,W ;id=733,key=000,flow seq=006 MOVWF FSR ;id=734,key=001,flow seq=006 MOVF 0x64,W ;id=735,key=002,flow seq=006 BCF STATUS,5 ;id=1285,key=000,flow seq=006 BCF STATUS,6 ;id=1286,key=000,flow seq=006 MOVWF INDF ;id=736,key=003,flow seq=006 where the MOVF 0x64,W should be MOVLW 0x64 ---------------------------------------------------------------------- Comment By: Raphael Neider (tecodev) Date: 2005-07-02 00:00 Message: Logged In: YES user_id=1115835 Works with SDCC 2.5.1 #1053. I will close this in less than a year if nobody disagrees ;-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2004-04-23 13:27 Message: Logged In: NO i have it working now chang line 8661 to if ( !AOP_INPREG(AOP(result)) && (AOP_TYPE(right)! =AOP_LIT) ) { and change at 8702 if (AOP_TYPE(right) == AOP_LIT) { unsigned int lit = (unsigned int) floatFromVal (AOP (IC_RIGHT(ic))->aopu.aop_lit); if(lit) { emitpcode(POC_MOVFW, popGet(AOP(result),0)); emitpcode(POC_MOVWF, popCopyReg(&pc_fsr)); emitpcode(POC_MOVLW, popGet(AOP(right),0)); emitpcode(POC_MOVWF, popCopyReg(&pc_indf)); // pic14_emitcode("movlw","%s",l); // pic14_emitcode("movwf","indf ;2"); } else good luck. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2004-04-22 21:49 Message: Logged In: NO i beleive i may have found out why in genNearpointerSet the folowin executes first. since our value to assign is a literal this gets executed and the literal never gets assigned /* if the value is already in a pointer register then don't need anything more */ if (!AOP_INPREG(AOP(result))) { /* otherwise get a free pointer register */ //aop = newAsmop(0); //preg = getFreePtr(ic,&aop,FALSE); DEBUGpic14_emitcode ("; ***","%s % d",__FUNCTION__,__LINE__); //pic14_emitcode("mov","%s,%s", // preg->name, // aopGet(AOP(result),0,FALSE,TRUE)); //rname = preg->name ; //pic14_emitcode("movwf","fsr"); emitpcode(POC_MOVFW, popGet(AOP(result),0)); emitpcode(POC_MOVWF, popCopyReg(&pc_fsr)); emitpcode(POC_MOVFW, popGet(AOP(right),0)); emitpcode(POC_MOVWF, popCopyReg(&pc_indf)); goto release; } i belive changing if (!AOP_INPREG(AOP(result)) to if (!AOP_INPREG(AOP(result) && (AOP_TYPE(right) != AOP_LIT)) should fix it. If it does it may have to be done in the other gen***pointerset ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=939042&group_id=599 |