There is one big problem with your code.
Code:
if counter = 50 ...
counter isn't guaranteed to ever be 50. Consider this scenario, counter is 49, and delta_t is 1. you increment counter as counter + 1 + delta_t. So after that loop, counter is 51. Since counter never equaled 50, you stay in that state forever (well, until counter overflows, and you have a chance to do it all over again).
You should be using >=
In my assembly class, we had a problem similar to this, except my professor rigged it so that if you just used = it was going to fail almost every time (to make it easier to find out). Since then, that's been one thing that I've always been careful about.