I think the problem is that your first example (eval data = %str((ptr1 : 5)) ) returns the expected 5 bytes from memory plus a null terminator, e.g. assuming the memory starting at ptr1 contains 'abcdef...', the operation would return 'abcde~', where '~' is the null terminator byte. On the other hand, when storing a value, as in your second example (eval %str(ptr1 : 5) = ‘abcdef’ ) it's going to try to store the string + a null terminator in the maximum length of 5 bytes you specified, so you'd get something like 'abcd~' since the operation will reserve 1 byte for the null terminator, leaving 4 bytes for data, and will then truncate all data after the 4th byte. Hope this helps -- Steve Shaffar

Reply With Quote
ffset+1:6) = 'abcdef' 