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

#include "filename.asm"

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



Joined: 03 Feb 2006
Posts: 13
Location: Minnesota

View user's profile Send private message

#include "filename.asm"
PostPosted: Thu Dec 28, 2006 4:53 pm     Reply with quote

We're implementing three interrupt handlers and another function in assy language. We'd like to keep the assy source in separate files in order to keep the C source a little cleaner. The only examples I can find for using assy code has the assy source embedded between the #asm-#endasm statements. We've used the #include directive as shown in the source below and it seems to work properly (and the .lst file looks correct).

Is this working purely by dumb luck or is this an approved method? If it's not an approved method I'd be concerned that a later compiler revision may not take kindly to this.

PIC18F2520
PCH ver 4.013

Code:

void rx_learn() {
   #pragma asm
   #include "rx_learn_store.asm"
   #pragma endasm
}

#INT_EXT
void isrRB0() {
   #pragma asm
   #include "isrRB0.asm"
   #pragma endasm
}

#INT_TIMER0
void isrTMR0() {
   #pragma asm
   #include "isrTMR0.asm"
   #pragma endasm
}

#INT_TIMER1
void isrTMR1() {
   #pragma asm
   #include "isrTMR1.asm"
   #pragma endasm
}
Ttelmah
Guest







PostPosted: Fri Dec 29, 2006 3:46 am     Reply with quote

With the 'caveat', that the assembler used will need to be CCS format, not generic assembler, this should work. #include, just behaves as if the file is 'typed in' at the point where it is invoked, so this should be acceptable in most compiler versions.

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