Arduino UNO/MEGA R3 Code not working.

Greetings.

I've been using this code in my old Arduino MEGA and it works perfectly. But when I upload it to an arduino R3 UNO or MEGA, it doesn't work.
THe code can be found here: http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/
If you are going to test it, be sure to set the input pins as digital inputs.

I'd like to know why this is happening.
Thank you.

Define "does not work".

It's doing direct register manipulation, which is not inherently portable. I would guess it's not implemented in a way which is compatible with the later platforms you mention.