modified so that the code would only write on .asm file from a directory