DaveBarnett Posted January 26 Share Posted January 26 I've declared some pointer arrays in script like this: It compiles...and works as expected...but, surely there must be a more compact/elegant way to get the same result? And, why is the editor complaining with the red squiggles ?? The SRM has the example: ptr FirstIoCardReg(8)->u.io:$A00000.8.8+ But, I couldn't get that kind of syntax to work..... Am I missing something?? Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted January 29 Share Posted January 29 Hi @DaveBarnett, What I know about that kind of syntax is this equivalence Sys.Udata[0] // u.user:0 Sys.Udata[1] // u.user:4 Sys.Udata[2] // u.user:8 Sys.Udata[3] // u.user:c The same applies for Idata, Fdata and Ddata (respecting the data structure organization) The u.user structure follows something like this u.user:{Beginning of that memory}:{Number of bits shifted}:{Number of bits}. Haven't been able to find the purpose of the "+" on your example, maybe is something specific for the BufIO. I'm also interested if there is anyway more elegant of handling those structures. Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted January 30 Share Posted January 30 (edited) For the Sys.Udata[x] stucture this seems to work ptr pUdata(8)->u.user:$24.0.32+ // OR u.user:36.0.32+ // OR u.user:36+ ,if not using offset or setting the maximum size pUdata(0),8 M8192=0 M8193=0 M8194=0 M8195=0 M8196=0 M8197=0 M8198=0 M8199=0 M8192,8-> M8192->u.user:$24 M8193->u.user:$28 M8194->u.user:$2c M8195->u.user:$30 M8196->u.user:$34 M8197->u.user:$38 M8198->u.user:$3c M8199->u.user:$40 Sys.Udata[9]=9,10,11,12,13,14,15,16 pUdata(0),8 M8192=9 M8193=10 M8194=11 M8195=12 M8196=13 M8197=14 M8198=15 M8199=16 Edited January 30 by leandro.martins 1 Quote Link to comment Share on other sites More sharing options...
DaveBarnett Posted January 30 Author Share Posted January 30 Good to know...! Thanks for sharing this. Quote Link to comment Share on other sites More sharing options...
steve.milici Posted February 6 Share Posted February 6 The “+” syntax is required in the IDE enhanced script language “ptr array” declaration to establish the correct address increments for each array element. Quote Link to comment Share on other sites More sharing options...
tecnico Posted February 29 Share Posted February 29 If I want to declare an array of bytes in contiguous memory area, what should the the syntax like? Tried this but I get a "sparse" array of bytes and this makes it impossible to reconstruct words and double words from a byte-only process image i get: appoIn(0),10->u.user:100.0.8+ appoIn(0),10-> M8192->u.user:$64.0.8 M8193->u.user:$68.0.8 M8194->u.user:$6c.0.8 M8195->u.user:$70.0.8 M8196->u.user:$74.0.8 M8197->u.user:$78.0.8 M8198->u.user:$7c.0.8 M8199->u.user:$80.0.8 M8200->u.user:$84.0.8 M8201->u.user:$88.0.8 I would like to have m8192->u.user:$64.0.8 m8192->u.user:$64.8.8 and so on Quote Link to comment Share on other sites More sharing options...
steve.milici Posted March 4 Share Posted March 4 The “+” syntax with “ptr” declarations does not function at the “byte” level, only with word level definitions. You would need to manually generate M-variable definitions and “#define” (function like macro definitions) names for your “byte” array. In this case do not use M-variable numbers in the “auto declared range” (MVARSTART and above). #define myArray(i) P[(800+i)] m800->u.user:$64.0.8 m801->u.user:$64.8.8 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.