This is ASM code:
In ASM arrays are not defined. Instead of defining each byte or word or long of array ASM use base address(like _Array) and offset.Code:@MOVE?BP _ARRAY[1] , TMP_32BIT
So if your array is byte I think that you can do it like this for array[1]
For wordCode:@MOVE?BP _ARRAY+1 , TMP_32BIT 'TMP_32BIT=Array[2] @MOVE?BP _ARRAY+2 , TMP_32BIT
For long index are 4,8 etc... Index must be constants!Code:TMP_32BIT=Array[1] @MOVE?WP _ARRAY+2 , TMP_32BIT TMP_32BIT=Array[2] @MOVE?WP _ARRAY+4 , TMP_32BIT ;Because each word in array uses 2 bytes, you increase index by 2.
For variable index is much easier to use temporally variable to hold result, than to work with pointers, etc in ASM. It can be done, I think that I post somewhere i TFT topic code for that.
Example for variable index:
Code:pbpTmp VAR BYTE/ WORD/LONG pbpTmp = Array[i] @MOVE?BP _pbpTmp , TMP_32BIT




Bookmarks