Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello everyone, would someone be kind enough to explain to me the meaning of the following sentence (found on page 34 of the FSUIPC For Advanced Users documentation in the paragraph 'Adding Simulator variables (simvars) to FSUIPC offsets'):
"Note also that the offset needs to be bound to the size. This means that if the size is 8, the last offset digit needs to be 0 or 8, if the size is 4, the last offset digit needs to be 0, 4, 8 or C, etc (but not for string types)."

Indeed I would have simply imagined that it is the following offset which had to take into account the size of the one which precedes it.

But this sentence makes me doubt!? Do you have the explanation, thank you

Posted

As it says - the offset address needs to be bound to its size. So, for example if you add a 1 byte simvar to, say, offset A000, the next free offset in that area will be A001. But if you now want to add an int, which is 4-bytes, you cannot add to A001 as that is not on a 4-byte offset boundary. The next position it can be added in will be A004 (the last offset digit needs to be 0, 4, 8 or C, i.e. on a 4-byte boundary).

Posted

This is the sentence I'm having trouble understanding! (I may be a bit limited, sorry): .... But if you now want to add an int, which is 4-bytes, you cannot add to A001 as that is not on a 4-byte offset boundary....

then I understand this: the offset addresses the END of the area allocated by the size at this offset, and not the start?

Posted

I cannot explain it any other way. A 4-byyte value MUST start on a 4-byte boundary.  So the hex address must end in 0, 4, 8 or C. Those are the 4-byte boundaries. If you add an int to an address ending with 0, e.g. xxx0, then the next address available is xxx4, and an int to that, and the next address available is xxx8, add an int to that, and the next address available is xxxC. 4-byte boundary addresses end in 0, 4, 8 or C. 8-byte boundary addresses end in 0 or 8.

Posted

ok thank you it's a little clearer in my head, I'll think about it with a clear head (it's necessary I think). In any case, thank you for your quick response (as usual),

Didier

Posted

thank you for this very interesting information, in addition to the simulation it stimulates the brain well ... these are very good exercises

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.