assembler code ported to nasm