In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dabayliss wrote: In the case where the index of the nested array is constant it is easy as you say. In fact for the (fairly common) case where the array is contained within a single bank I believe you can do: mov fsr,#idx mov w,#arr1 add w,ind mov fsr,w it is a little more exciting which the index of the nested array is variable to arr1[arr2[i]] = 42 but still not impossible: [code] arr1 equ $3a arr2 equ $5a i equ $a val equ $8 org 0 reset Start Start: ; Preamble to allow 'stepping through' in SXSIM mov i,#2 mov fsr,#arr2+2 mov ind,#3 mov val,#$42 ; Attempting arr1[arr2[i]] = val - arr1[arr2[2]] - arr1[3] in test = $3d mov w,#arr2 ; requires a bank instruction here if i not 'already available' add w,i mov fsr,w mov w,#arr1 add w,ind mov fsr,w ; Job done - line below as a 'proof' mov ind,val As in Peter's post if Arr1 or Arr2 span banks it is a little uglier .... David[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=328791#m328825 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)