replaced busy looping with a asm halt