I've read a number of threads that have debates over whether PCs are better than consoles. A common argument is that PCs are better because the consoles use the same hardware for several years and PCs are constantly upgrading. I'm in college for software engineering, so this post will be more about software than hardware. It's time to learn about machine code.
When writing games or any software really, it's common to use some sort of high level programming language like C++, Java, Python, or whatever. The CPU can't understand Java or any of these languages. It can only understand machine code. It's possible to program in machine code but usually it's done in assembly code. Basically, machine code is binary, and assembly are instructions based on English words. While a high level language like C or Java would need several machine instructions for each line of code, there is a one to one equivalence between assembly and machine code.
So why would people use machine/assembly code? Well when a programming in a high level language it often gets compiled into inefficient machine code. The reason for this is that different processors have different instruction sets. In order to run software on any PC it has to use generalized and inefficient instructions that all processors have. A processor might have multiple instructions for loading memory into CPU registers, or multiple add instructions or multiple compare instructions. These instructions take up fewer clock cycles than the generalized form, but can only be used in certain circumstances. However in order for software to run on multiple processors it must use the generalized form of the instruction.
Consoles have one crucial advantage over PCs. Every single PS3 has the same processor, hence same instruction set. Evey single Xbox 360 has the same processor etc. Same for Wii. When making a console exclusive it's possible to use any of the time saving and processor specific instructions because every console of that type will have those instructions available.
Not really trying to takes sides, because I enjoy PC and console games but the next time you think that better hardware makes PC games better, consider that it's possible to run better software on worse hardware by using more efficient machine code.
When writing games or any software really, it's common to use some sort of high level programming language like C++, Java, Python, or whatever. The CPU can't understand Java or any of these languages. It can only understand machine code. It's possible to program in machine code but usually it's done in assembly code. Basically, machine code is binary, and assembly are instructions based on English words. While a high level language like C or Java would need several machine instructions for each line of code, there is a one to one equivalence between assembly and machine code.
So why would people use machine/assembly code? Well when a programming in a high level language it often gets compiled into inefficient machine code. The reason for this is that different processors have different instruction sets. In order to run software on any PC it has to use generalized and inefficient instructions that all processors have. A processor might have multiple instructions for loading memory into CPU registers, or multiple add instructions or multiple compare instructions. These instructions take up fewer clock cycles than the generalized form, but can only be used in certain circumstances. However in order for software to run on multiple processors it must use the generalized form of the instruction.
Consoles have one crucial advantage over PCs. Every single PS3 has the same processor, hence same instruction set. Evey single Xbox 360 has the same processor etc. Same for Wii. When making a console exclusive it's possible to use any of the time saving and processor specific instructions because every console of that type will have those instructions available.
Not really trying to takes sides, because I enjoy PC and console games but the next time you think that better hardware makes PC games better, consider that it's possible to run better software on worse hardware by using more efficient machine code.