From: SourceForge.net <no...@so...> - 2004-04-22 21:49:39
|
Bugs item #939042, was opened at 2004-04-20 20:45 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=939042&group_id=599 Category: pic14 target Group: None Status: Open Resolution: None 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: Nobody/Anonymous (nobody) Date: 2004-04-22 14: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 |