From: SourceForge.net <no...@so...> - 2012-03-18 11:00:12
|
Bugs item #3496842, was opened at 2012-03-04 12:30 Message generated for change (Settings changed) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3496842&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: mcs51(8051) target Group: fixed >Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Joe (smz2552) Assigned to: Maarten Brock (maartenbrock) Summary: sfr16 type code can't be assembled - mcs51 Initial Comment: Build 3.1.3 #7396 but fails on older builds too. See attached test case. The sfr16 type generates assembly code that fails. ; bug_sfr16.c:26: TMR2RL = 0x1234; // 16b Broken mov _TMR2RL,#0x34 << ERROR mov (_TMR2RL >> 8),#0x12 ; bug_sfr16.c:29: TMR2RLL = counts; // 8b OK, truncated // Init reload values mov _TMR2RLL,#0x00 $ /cygdrive/c/Tools/sdcc/bin/sdcc --debug -DSDCC -V -I./INC "bug_sfr16.c" removing bug_sfr16.rel bug_sfr16.asm:954: Error: <d> direct page addressing error + C:\Tools\sdcc\bin\sdcpp.exe -nostdinc -Wall -DSDCC -I./INC -obj-ext=.rel -D__SDCC_MODEL_SMALL -D__SDCC_FLOAT_REENT -D__SDCC=3_1_3 -D__SDCC_REVISION=7396 -D__SDCC_mcs51 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "C:\Tools\sdcc\bin\..\include\mcs51" -isystem "C:\Tools\sdcc\bin\..\include" "bug_sfr16.c" + C:\Tools\sdcc\bin\sdas8051.exe -plosgffwc "bug_sfr16.rel" "bug_sfr16.asm" + C:\Tools\sdcc\bin\sdas8051.exe -plosgffwc "bug_sfr16.rel" "bug_sfr16.asm" returned errorcode 2 ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2012-03-18 03:35 Message: Fixed in SDCC 3.1.3 #7461 ---------------------------------------------------------------------- Comment By: Joe (smz2552) Date: 2012-03-04 13:26 Message: Original Code (also in attached) #include <C8051F340.h> // SDCC SFR declarations //__sfr16 __at (0xCBCA) TMR2RL ; void main (void) { int counts; counts = 0; // TMR2RL is sfr16 from header definition // TMR2RL = 0x1234; // 16b Broken //TMR2RL = counts; // 16b Broken //TMR2RL = 0x0002; // 16b Broken // Init reload values TMR2RLL = counts; // 8b OK, truncated // Init reload values //TMR2 = 0xffff; // Set to reload immediately } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3496842&group_id=599 |