- When it is said that machine code is specific to a machine, is it specific to an architecture, or is it specific to a machine? Do two identical processors require different machine code? My guess is that people are referencing instruction sets/architecture when they say machine code is specific to a machine?
- If they are referencing instruction sets; how does a compiler know which instruction set to create machine code for? -Ultimately -- if I compile a C program on my computer, generating machine code, to what extent is that machine code usable on other machines?
Like, if one of the points of compiled languages is that you don't have to share the source code, how does that even work? Don't you have to, at a minimum, compile for each available architecture?
edit: Sorry if these questions seem easily googleable, believe me I have tried. It's at the point where I need to just start asking people things, which is why I've made this account.