A program written in machine language is written in 0's and 1's, a hack program file consists of rows of combinations of 0's and 1's. My question is how is the hack program file loaded into RAM, ex:
First line of hack program file: 0010101010100101
Does the computer read that line and automatically puts the line in the register in RAM, I don't think that is the case but how does the computer read the line and hardwire it to RAM. It's like when it reads a 1 in the row it turns on some switch to produce that 1. I am very confused, I am sure this knowledge isn't needed to continue but I would like to know. Thank you for your help much appreciated.
The CPU Emulator reads the .hack file and puts the instructions in the file into the simulated ROM. The first line of the files is loaded into ROM, etc.
The way that ROM gets programmed on actual hardware varies a bit depending on the exact hardware. An example would be for the Microchip PIC processor I use in one of my customer's products, the code is developed on a Windows PC and a debugging/programming pod connects to the PC with USB and to the PIC with a special interface. The PC can then erase and reprogram the ROM.