View previous topic :: View next topic |
Author |
Message |
FISH6942
Joined: 03 Feb 2006 Posts: 13 Location: Minnesota
|
#include "filename.asm" |
Posted: Thu Dec 28, 2006 4:53 pm |
|
|
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
|
|
Posted: Fri Dec 29, 2006 3:46 am |
|
|
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 |
|
 |
|