Every processor runs machine code, this is a bunch of 1s and 0s. Machine code is directly created from assembly. So at some level a computer or phone is running assembly. However assembly has two problems:;
1. It’s really difficult to write and takes a long time to write.
2. Assembly written for one processor will not work on a different type of processor.
This means that if you spend loads of extra effort writing a program in assembly, you have to write it all again as soon as you need it to work on another device.
We have languages that are one level above assembly, like C. This language is still pretty hard to write, but a lot easier than assembly. We have something called a compiler that takes our C code, and we tell it what kind of processor we want it to run on, and it automatically creates the machine code that works for that CPU.
Above C we have other languages, like Python, Java, Go etc. These are even easier to write code with, but as we aren’t quite as close to programming the hardware directly it isn’t always possible to write code that runs as quickly.
The processor itself generally doesn’t run firmware. However the processor on a phone is actually a collection of several different components together, like the CPU and the GPU. A GPU is a more specialized piece of hardware, and so might have a tiny processor inside it that runs firmware to translate signals from the CPU into actions for the GPU to run.
Every processor out there is technically programmed in assembly, because assembly is essentially a one to one with machine code. Machine code is the instructions in 1’s and 0’s that are loaded into memory that the processor executes. Every single program that runs on a modern processor, regardless of language, is compiled into machine code to run on the processor.
Processors are hardware components. Literally at the nano level they are sets of transistors and traces that allow signals to get passed around. Modern processors are extremely complex, including multiple caches ok the processor to be able to reduce latency associated with getting information from your main memory (RAM) and your storage (hdd, ssd, etc.)
As far as I’ve learned there is no firmware directly on the processor, but the motherboard it is connected to does. The firmware on the motherboard is really just a set of how to run the processor, the operating system then has drivers that interface the operating system to the motherboard firmware.
All processors run some form of machine code. Assembly is machine code short-hand for humans.
For example, many smartphones use ARM architecture and assembly. There are others, but all probably have some form of assembly code.
There is fundamentally very little functional difference between a smartphone and a computer.
Processors run on “machine code” a.k.a. “object code,” which is basically just numbers that tell the processor what to do. Assembly language is a type of “source code” (i.e., what programmers write) that’s very close to object code. You can write programs using Assembly, but it’s a major pain in the ass and rarely worth the effort.
General-purpose processors (like the one in your computer) don’t *get* programmed. They *run* programs. The programs can be written in many programming languages. One way or another, they’ll be translated into something the processor can understand – either before running (compiled languages) or while running (interpreted languages).
“Firmware” is really just software stored in static memory that controls interaction with hardware. Your computer’s “firmware” is the BIOS, which is stored in the motherboard. Other pieces of your computer, or devices connected to it, might have their own firmware.
Yes, some processors have ‘microcode’ which is essentially firmware. Externally the CPU will execute standard machine language for that architecture (eg x86), but internally the CPU will be executing its own RISC-like microinstructions. Intel can use this to patch any hardware bugs in the physical CPU.
Latest Answers