It doesn't.
Main memory is usually volatile (that is, it "forgets" when power is removed).
Most microprocessor systems keep a "bootloader" which is a special type of program located in memory that is available when power is applied. These days, that is usually Flash memory.
So, a typical microprocessor boot sequence is that the microprocessor places a known starting address on the Flash's address lines. The data that is returned is then executed. This data forms a basic program which copies from the Flash memory into main memory. Control then shifts to the main memory when the Flash has been completely read.
There may be additional aspects to the booting process, such as the second-stage boot loader which is responsible for loading the operating system, usually from a disk drive rather than Flash.
Chat with our AI personalities