DaveBarnett Posted February 8 Share Posted February 8 (edited) It would be useful to be able to use 2’s complement math in Script. But, I noticed the following oddity: Sys.Udata[0]++ // doesn’t rollover… it saturates instead but, Sys.Idata[0]++ // does rollover and Sys.CData[0]++ //does rollover To wrap my head around this… I created the following watch window: I would have expected the unsigned data to be the one that rolls over. 'Curious. Can we rely on this rollover behavior not to change in future firmware ?? I haven't tried it yet..but I wonder if this behaviour is the same when using C routines instead of script. If you want to try out for yourself, I’ve attached the watch window XML file. -Dave UdataRollover.wtb Edited February 8 by DaveBarnett 1 Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted February 9 Share Posted February 9 Not much related, but it might be interesting to add for discussion. Recently I have faced some differences on Sys.Cdata[i] structure between different firmware versions. I can't say if the difference is due to firmware version, or is something more intrinsic to the cpu (since the PowerPC endianess diverge from the ARM). While in fw 2.5.0.4 the Sys.Udata[0] points to the same region of Sys.Cdata[3], in fw 2.7.1.0 Sys.Udata[0] points to the same location of Sys.Cdata[0]. About the roll over, I have tested and both of the versions presented the same behaviour that Dave described. 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.