start of asm rewrite