From: Marcin W. <wol...@fr...> - 2001-02-13 10:56:31
|
Hi, I need your help with following issue: I wrote some code (Dallas 80c320 256B iram, sdcc v.2.2.1/2.2.2) that uses longs. I declared at most (including deepest function calls) 10- 12 longs + some variables, that are in 'idata' area. But SDCC reports, that it run out '51 of resources. And it surely did- there are somewhere about 74 longs named _foo_slocn_1_0 (where 'n' is variable number, foo- function name- each declared by sdcc) which are declared by SDCC and used only once (mostly) in some peculiar way: lcall _gtime ;get time mov _main_sloc0_1_0,dpl mov (_main_sloc0_1_0 + 1),dph mov (_main_sloc0_1_0 + 2),b mov (_main_sloc0_1_0 + 3),a mov dpl,#0x6F lcall _clkrdlw ;read from ext. storage mov _main_sloc2_1_0,dpl mov (_main_sloc2_1_0 + 1),dph mov (_main_sloc2_1_0 + 2),b mov (_main_sloc2_1_0 + 3),a ;above- loading two longs to sloc0 i sloc2 ;and now subtracting clr c mov a,_main_sloc0_1_0 subb a,_main_sloc2_1_0 mov _main_sloc1_1_0,a mov a,(_main_sloc0_1_0 + 1) subb a,(_main_sloc2_1_0 + 1) mov (_main_sloc1_1_0 + 1),a mov a,(_main_sloc0_1_0 + 2) subb a,(_main_sloc2_1_0 + 2) mov (_main_sloc1_1_0 + 2),a mov a,(_main_sloc0_1_0 + 3) subb a,(_main_sloc2_1_0 + 3) mov (_main_sloc1_1_0 + 3),a There are two local variables- scloc0 is used here and only here and never reused- all it's purpose is to keep one long for a while. Such a variables, that are used once are repeated, occupying space... Question is- what can I do with this? Except modyfying asm files manually? Regards, Marcin Wolcendorf. -- |