Replaced assembly code with macro