inyeop wrote
I'm trying to write hdl code for arr[j]=17.
 
Working backwards you need 17 in D and arr+j in A so that the last instruction
    M=D
will set arr[j] = 17.
The only way to get 17 in D is by using A either as @17 or as a memory address for some RAM that contains 17.
    @17
    D=A
Now you need to get arr+j into A 
without changing D. The only way to do this is to have arr+j stored in RAM somewhere.
You will need to use a temporary variable. Do something like
    compute R15 = arr+j
    load 17 into D
    load R15 value into A
    M=D
--Mark