That doesn't answer my question. I don't care what assembler you used.
You say it didn't work well when you executed it. So what result did you get?
The easiest way to discover faults in this sort of program is to run it under a debugger. Single-step it and see what is happening.