To add on to what Frank said since you mentioned compiling:
You can certainly assemble/compile a 32-bit program on a 64-bit computer. You can also assemble/compile a 64-bit program on a 32-bit machine. However, you cannot execute the 64-bit program within a 32-bit operating system, but you can indeed execute a 32-bit program on a 64-bit OS due to backward compatibility.
The x64 ABI really has only two major conventions of interest - one is Windows and the other is UNIX ( as currently implemented by the BSD's and Linux ). Of course, if you're writing your own OS you're free to also write your own conventions but that also means writing all the tool-chain support ( compiler, linker, debugger, etc. ).