If you have a pure assembler file, you need to use an assembler to compile separate object code to be linked later on. The gcc compiler is expecting C syntax, which is why the asm() stuff is needed in the C program.
Maybe gcc has an assembler option that will do the trick. I don't know and can't check because I ain't got it. Someone else should help with that.