I'm new into assembly language and I understood that fetching data from memory can be done only through use of registers. Therefore:
MOV eax, x // x is an integer
MOV y, eax
- The machine code of a MOV operation consist of the CPU instruction and the addresses of the operands and registers. True or false ?
- In the RAM, the integer will be stored in 4 different memory locations. True or false ?
Considering an x86 32b processor architecture, when the CPU executes the MOV instruction to load the data (mov eax, x), in the case of the 4bytes data from RAM, it means that it must execute 4 instructions to get the data from all the 4 address that make up an integer of 4bytes, join the bytes together and put them into the EAX register.
Is this how the CPU does the job ?
How does the CPU know how many bytes it should read ?