I'm currently working my way through Andrew Appel's Modern Compiler Implementation in Java, and I'm right around the point where I build the low-level intermediate representation.
Initially, I had decided to target the JVM and ignore all of the low-level machine stuff, but in the interest of learning things that I don't know much about I've had a change of heart. This changes my IR, because targeting the JVM allows me to (more or less) wave my hands at making a method call or constructing an object.
The Appel book doesn't go into detail about any specific machine architecture, so I'd like to know where I can find out everything I need to know to go farther.
The things that I'm currently aware that I need to know are:
Which instruction set to use. I have two laptops I could develop on; both have Core 2 Duo processors. My current understanding is that x86 processors mostly use the same instruction set, but they are not all exactly the same.
Whether the operating system affects the code generation step of compilation, or whether it is completely dependent on the processor. For example, I know something is different about generating code to run on a 32-bit vs. a 64-bit platform.
How stack frames and such are organized. When to use registers vs. putting parameters on the stack, caller-save vs. callee-save, all of that. I'd have thought that this would be described along with the instruction set but so far I haven't seen this particular info anywhere. Maybe I'm misunderstanding something here?
Links to resources in lieu of answers are perfectly welcomed.