We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I want to write the interrupt routines in assembly ,i don't want to use inline assembly.
cseg at interrupt_vector ljmp isr . . . isr: isr_code reti
A couple more tips: Keep your interrupt vectors and servicing routines in a separate source file (e.g. "IRQ.A51") to save yourself some work. Also, in Jon's code he did not explicitly show you that the service routines are typically placed in a relocatable segment, not an absolute segment. (And if your interrupt service routine is less than 8 bytes, you do not need the LJMP!) So, showing the segment declarations...
IRQ_procs segment code cseg at vector_address1 ljmp irq_name1 . cseg at vector_address2. ljmp irq_name2 . rseg IRQ_procs irq_name1: isr_code . . reti irq_name2: . . .
The file C:\Keil\C51\ASM\Template.A51 contains almost everything that you need.