how big is a bit in openmw's scripting (how big is a bool)

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
maqifrnswa
Posts: 180
Joined: 14 Jan 2013, 03:57

Re: how big is a bit in openmw's scripting (how big is a boo

Post by maqifrnswa »

Pop000100 wrote:global longs only have 24 bits of precision according to MSFD 9, but that document isn't right about everything. wait... so there is no performance impact in using a short instead of a long because they are all 32-bit(in openmw)?

PS you can move this thread if it is deemed off topic in this forum
damn, I wrote an awesome long reply and it disappeared! Pretty much what chris said.

Also, the original compiled morrowind scripts store all intergers as 32 bit wide words (strings can be arbitrarily long and are just zero-padded to 32 bit wide words, so you could store an arbitrarily long number as a string). The original VM had stacks for global/local long, short, floats (since there are opcodes to push to/pop from them). However, there was only opcodes for integer and float operations, so it looks like it didn't care what type of int it was. The original opcode for move was 8 bits, so it allowed for another 24 bits of payload (which is maybe where the global short size came from?)

Since machines were all 32 bit at the time, my guess is that the long, short, and float stacks were all 32 bit as well for the reason chris suggested, especially since the operations were done on the whole stack value as an int or float not as a short int or long int.
Post Reply