If it's not easy to remove this limitation, is it instead possible to emit a warning if __interrupt() is used in a file without main()?
If it's not possible to remove this limitation, is it instead possible to get a warning if __interrupt() is used in a file without main()?
My apologies, it seems you are correct. If I compile version1.c (which has everything in one file) with the following commands then the ISR works correctly: sdcc -c ../version1.c sdcc version1.rel -o version1_rel.ihx packihx version1_rel.ihx > version1_rel.hex I didn't spot that in the manual, thanks for the ref: If you have multiple source files in your project, interrupt service routines can be present in any of them, but a prototype of the isr MUST be present or included in the file that contains...
MCS51: __interrupt() is broken by "-c" (--compile-only)