CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Optimization? what is this logic?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

Optimization? what is this logic?
PostPosted: Fri Jul 09, 2004 4:56 pm     Reply with quote

Code:
....................output_a(0x00); set_tris_a(0b00101111);
076E:  CLRF   F89
0770:  MOVLW  2F
0772:  MOVWF  F92
....................output_b(0x00); set_tris_b(0b00000001);
0774:  CLRF   F8A
0776:  MOVLW  01
0778:  MOVWF  F93
....................output_c(0x00); set_tris_c(0b10000000);
077A:  CLRF   F8B
077C:  MOVLW  80
077E:  MOVWF  F94
....................output_d(0x00); set_tris_d(0b00000000);
0780:  CLRF   F8C
0782:  MOVLW  00 //why not CLRF F95 ?
0784:  MOVWF  F95
....................output_e(0x00); set_tris_e(0b00000011);
0786:  CLRF   F8D
0788:  BSF    F96.0 //why not MOVLW 3
078A:  BSF    F96.1 //            MOVWF F96 ?
078C:  BCF    F96.2
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 09, 2004 8:03 pm     Reply with quote

Quote:
output_e(0x00);
set_tris_e(0b00000011);
0786: CLRF F8D
0788: BSF F96.0 //why not MOVLW 3
078A: BSF F96.1 // MOVWF F96 ?
078C: BCF F96.2


They are also doing this BSF, BCF stuff with the ADC functions,
and with the initialization code inserted at the start of main().
I have emailed them about this, and asked them to go back
to the byte-wide writes instead of doing bit diddling. So far,
they have ignored the issue. All of this started with vs. 3.2xx.

The more people that complain to them about this, the better,
because otherwise, they won't ever change it. Please email
support@ccsinfo.com about it. Show them your code above.
C-H Wu
Guest







Re: Optimization? what is this logic?
PostPosted: Fri Jul 09, 2004 10:42 pm     Reply with quote

future wrote:
Code:
....................output_e(0x00); set_tris_e(0b00000011);
0786:  CLRF   F8D
0788:  BSF    F96.0 //why not MOVLW 3
078A:  BSF    F96.1 //            MOVWF F96 ?
078C:  BCF    F96.2


0xF96 is _VERY_ special, it is quite different from 0xF92.

Considering 18F452, SFR 0xF96 has 8 bits including PSPMODE, IBF, OBF, IBOV and three bits for TRISE, as a result, MOVLW 3, MOVWF F96 will not just set your tris bits but also set other SFR bit you might _NOT_ want.
Using bit setting for set_tris_e() with 0xF96 is necessary.

set_tris_e() shall be, and must be, quite different from set_tris_a(). Cool

Best wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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