This is ASM code:
Code:
@MOVE?BP _ARRAY[1] , TMP_32BIT
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.
So if your array is byte I think that you can do it like this for array[1]
Code:
@MOVE?BP _ARRAY+1 , TMP_32BIT
'TMP_32BIT=Array[2]
@MOVE?BP _ARRAY+2 , TMP_32BIT
For word
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 long index are 4,8 etc... Index must be constants!
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