Fixed emulation of LOOP/ENDL