Cypress
This program is based on code kelvinu posted in another thread. I cannot get the interrupt/pin toggle to work, and I don't have enough assembly experience to identify the problem.
Why not just do it in C to start out with? Then you can look at the disassembly to see if you can optimize it (but I doubt you really need to).
/Ruben