[Vm-dev] VM endianness
Eliot Miranda
eliot.miranda at gmail.com
Wed Mar 18 16:51:44 UTC 2015
Hi Clément,
On Wed, Mar 18, 2015 at 7:26 AM, Clément Bera <bera.clement at gmail.com>
wrote:
>
> Hello,
>
> Is there a primitive or a parameter that I can call from the image to know
> the endianness of the processor / VM ?
>
Amazingly no (well it surprised me, anyway). Squeak has an elaborate
BitBlt-based scheme for calculating it. But in Spur we know adoptInstance:
between bit objects will work so we can do the following:
| f |
f := BoxedFloat64 new.
f at: 1 put: 1; at: 2 put: 1.
ByteArray adoptInstance: f.
f first = 1 ifTrue: [#little] ifFalse: [#big]
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150318/444af5cf/attachment.htm
More information about the Vm-dev
mailing list