Given the following code:
int x=4;
int g=2;
int z=x/g;
as far as I know, the value '4' is stored in the memory in a place belong to x
and '2' is stored in g
's place in the memory.
Now, when the CPU gets the z=x/g
command, first of all he gets the value of x
and g
from the memory, then he calculates the result, and stores it in z
.
But what happens as the following code runs:
int x=4;
int z=x/2;
After the CPU gets '4', how can he get the '2'? does a CPU command can hold Data rather then addresses and opcode?