I wrote a variant of the code above ( although the JMP may have involved self-modifying code ) as my first foray into using interrupt-driven 6502/6510 code.
I still remember seeing the SEI / CLI instructions in a sample in a magazine and swearing that the author had to have the instructions reversed! Of course, SEI disables interrupts while CLI re-enables them.
The 18.2 hz frequency of the IRQ calls coincided nicely with the raster refresh to produce a very smooth series of scrolling stripes in the border. ( This effect only works on a real 64 or 128 ... not an emulator.
To use the above program after assembling....
Back to Jimbo's Demented Software
LOAD "C64IRQ",8,1
SYS 49152