I'm currently developing my degree thesis, and the lab's idea is to design a new micro architecture, and then, be able to compile stuff for this architecture. So the question is, how do you instruct a compiler to generate your new assembler??? The general idea is to be able to compile with gcc and run netbsd or similar kernel with this new architecture. Well, thanks a lot!
Many compilers, gcc included, are divided into two major parts: a front-end and a back-end. The front end is in charge of compiling the input language into some sort of intermediate form, and perform some of the optimization. The back-end takes this intermediate form and generates actual machine code. You only need to construct a new back-end (or even less than that). Luciano in his answer gave you a good pointer regarding that.