|
Since the value of i is not known at compile time, it is impossible to create an STD instruction to copy j's value into stuff[i]. Instead, the address of stuff[i] must be calculated by adding the base address of array stuff, 1000, to the value of i. This type of activity is called address arithmetic. The CSC-1 computer stores one integer in one word of memory. Many current machines which are byte-addressable use at least 4 words to store one integer, so the value of i would have to be multiplied by 4 to get the address of the right integer on these machines. Multiplication by 4 can be done efficiently by left shifting the value of i two bits. |