How do I write an ISR greater than 8 bytes which is triggered by INT0?

  • 3
    \$\begingroup\$ You place a jump instruction at the address of the interrupt handler, which then allows the actual handler code to be placed anywhere in memory where there's enough room for it. \$\endgroup\$
    – Dave Tweed
    Oct 5, 2014 at 15:02
  • \$\begingroup\$ ORG 0003H ; LJMP START; RETI like this? \$\endgroup\$
    – user258699
    Oct 5, 2014 at 15:14
  • 2
    \$\begingroup\$ What is that RETI for at that place? There is no return from a jump, so the RETI must be at the end of the code that you jump to. \$\endgroup\$ Oct 5, 2014 at 15:21

1 Answer 1


Your code jumps to the ISR which ends in a RETI:

    org 0003H
    jmp isr

    ; ...

    ; any instruction you need

If you program in C, this will be handled for you automatically. For example, Keil-C51 places ISRs right at the start address if there is enough room, or jumps to it if not.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.