Minimal code on an AVR MCU with interrupt enabled - hard-coded interrupt table nostartfiles
Playing with interrupt with no start file compiled. This is playing low level stuff with semi-high level c code and assembly inline, and this is not the best example, but it works, and it saves 5 bytes of flash memory if it were to be done normally because the atiny13a tested has only few interrupt, and not much garbage has been generated by the default start file. More still can be done to trim some fat.
The interrupt tablet is located at first few address locations on the flash memory space. Total 9 interrupts are available in the 13a, so 18 bytes are dedicated for the interrupt table. Each lookup table is only 4 bytes wide, so nothing else but a rjmp instruction fits into that tiny amount of space. Essentially, when an interrupt has occurred, the MCU first jumps to the interrupt location, and then from here it jumps to somewhere else defined by the user.
This implies 2 things: 1, if the last interrupt and only the last is used, then it's very hard to utilize the top 16 bytes of memory, and so they are probably blanked anyway; 2, use polling interrupt when it's possible.