| 
	
	|  |  |  
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| Charlie U Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Missing Multiply Listings |  
				|  Posted: Sat Nov 09, 2002 8:29 pm |   |  
				| 
 |  
				| Version 3.123, 16F877 
 I just tried a quick multiply test to see how much code/time it takes.  I checked the .lst file, and the assembly code for the multiply is missing.  The listing for the multiply is:
 
 ....................    c=a*b;
 00B2:  MOVF   20,W
 00B3:  MOVWF  25
 00B4:  MOVF   21,W
 00B5:  MOVWF  26
 00B6:  GOTO   004
 00B7:  MOVF   78,W
 00B8:  CLRF   7A
 00B9:  MOVWF  77
 00BA:  BTFSC  77.7
 00BB:  DECF   7A,F
 00BC:  MOVWF  22
 00BD:  MOVF   7A,W
 00BE:  MOVWF  23
 
 a and b are signed ints, and c is a signed long.
 
 I reviewed the listing and there is nothing for address 0004, just a big hole.  I checked the .hex file and there is code in the "hole", but I haven't tried to disassemble it yet.  The program is small (see below) and it does not go over a page boundary.  I tried this with 2.374 and the multiply is listed just after the c=a*b; even though the addresses are way out of order.
 
 Has anyone else noticed this?
 
 main .c file:
 
 #include "x_tst1.h"
 
 signed int a,b;
 signed long c;
 
 void main() {
 
 setup_adc_ports(NO_ANALOGS);
 setup_adc(ADC_CLOCK_DIV_2);
 setup_psp(PSP_DISABLED);
 setup_spi(FALSE);
 setup_counters(RTCC_INTERNAL,WDT_18MS);
 setup_timer_1(T1_DISABLED);
 setup_timer_2(T2_DISABLED,0,1);
 enable_interrupts(INT_TIMER1);
 enable_interrupts(global);
 a=0x11;
 b=0x11;
 c=a*b;
 printf("c=\%4lx", c);
 while (1)
 {
 ;
 }
 }
 
 include x_tst1.h:
 
 #include <16F877.h>
 #device *=16
 #use delay(clock=20000000)
 #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7)
 #fuses HS,PUT,WDT
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 8717
 |  |  
		|  |  
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				| Re: Missing Multiply Listings |  
				|  Posted: Sat Nov 09, 2002 11:01 pm |   |  
				| 
 |  
				| :=Version 3.123, 16F877 :=
 :=I just tried a quick multiply test to see how much code/time it takes.  I checked the .lst file, and the assembly code for the multiply is missing.
 -------------------------------------------------------
 
 Whenever CCS does "optimization improvements", I always cringe.
 They always introduce far more bugs than they fix.
 Here are some examples from their old versions pages:
 
 2.711  Optimization improvments
 2.712  Various bugs in 2.711 fixed
 -------------
 2.719  Optimization updates
 2.722  Optimization bug fixed
 ------------
 3.048  PCW optimization improved
 3.048  Some I2C glitches fixed
 3.049  A floating point math error is fixed
 3.050  Fixed an optimization bug affecting large programs with complex math
 3.053  An optimization bug is fixed.  This affected some built in functions like math
 3.054  Reduced PIC18 optimization to eliminate some user
 reported problems while we investigate
 ---------------
 
 3.093  Linker algorithm has been optimized
 3.094  PCB was broke (version 3.093) and is now back
 ---------------
 
 3.097  Optimization improvments
 3.099  Fixed optimization problems (#opt 7 removes new opt, #opt 8 uses it)
 -------------------
 3.101  More optimization improvments
 3.103  Optimization bug fix
 3.104  Another optimization bug fix
 
 =============================================
 
 I think we have a pattern here.
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 8721
 |  |  
		|  |  
		| Dale Herman Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Use dissembler or MPLAB to view code |  
				|  Posted: Sun Nov 10, 2002 7:47 pm |   |  
				| 
 |  
				| Use MPLAB to look at the code. Some library or built-in sequences don't show up in listing file, but they do in MPLAB.
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 8739
 |  |  
		|  |  
		| Charlie U Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Re: Missing Multiply Listings |  
				|  Posted: Mon Nov 11, 2002 9:48 pm |   |  
				| 
 |  
				| :=:=Version 3.123, 16F877 :=:=
 :=:=I just tried a quick multiply test to see how much code/time it takes.  I checked the .lst file, and the assembly code for the multiply is missing.
 :=-------------------------------------------------------
 :=
 :=Whenever CCS does "optimization improvements", I always cringe.
 :=They always introduce far more bugs than they fix.
 :=Here are some examples from their old versions pages:
 :=
 :=2.711  Optimization improvments
 :=2.712  Various bugs in 2.711 fixed
 :=-------------
 :=2.719  Optimization updates
 :=2.722  Optimization bug fixed
 :=------------
 :=3.048  PCW optimization improved
 :=3.048  Some I2C glitches fixed
 :=3.049  A floating point math error is fixed
 :=3.050  Fixed an optimization bug affecting large programs with complex math
 :=3.053  An optimization bug is fixed.  This affected some built in functions like math
 :=3.054  Reduced PIC18 optimization to eliminate some user
 :=reported problems while we investigate
 :=---------------
 :=
 :=3.093  Linker algorithm has been optimized
 :=3.094  PCB was broke (version 3.093) and is now back
 :=---------------
 :=
 :=3.097  Optimization improvments
 :=3.099  Fixed optimization problems (#opt 7 removes new opt, #opt 8 uses it)
 :=-------------------
 :=3.101  More optimization improvments
 :=3.103  Optimization bug fix
 :=3.104  Another optimization bug fix
 :=
 :==============================================
 :=
 :=I think we have a pattern here.
 :=
 
 I emailed my concern to CCS and they replied that many people were confused by the order the compiler used for library routines such as the multiply.  They are placed just after the #device directive from the device .h file.  If the (default!)#nolist directive is commented out, the library routines will be included in the listing.  I have verified this in 3.123.
 
 Thanks for the replies and help.
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 8771
 |  |  
		|  |  
		|  |  
  
	| 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  
 Powered by phpBB © 2001, 2005 phpBB Group
 
 |