[Vm-dev] VM endianness

Eliot Miranda eliot.miranda at gmail.com
Wed Mar 18 17:15:08 UTC 2015


On Wed, Mar 18, 2015 at 9:57 AM, Guillermo Polito <guillermopolito at gmail.com
> wrote:

>
> In Pharo it is similar. However, we would like to have an image where
> BitBlt and Form are not there.
>

Here's one that works on both Spur and V3.  It only works on a Cog or Stack
VM (and hence is OK for Pharo) since it depends on Floats being stored in
the platform order internally.


| f |
f := Float new.
f at: 2 put: 1. "store the least significant word of the float with 1; on
big endian machines this is the second word"
Bitmap adoptInstance: f.
f first = 1 ifTrue: [#little] ifFalse: [#big]


> El mié., 18 de mar. de 2015 a la(s) 5:52 p. m., David T. Lewis <
> lewis at mail.msen.com> escribió:
>
>>
>> It is easy to add a primitive for this, but it should not be necessary.
>> See SmalltalkImage>>calcEndianness in Squeak.
>>
>> Dave
>>
>> >  Hello,
>> >
>> > Is there a primitive or a parameter that I can call from the image to
>> know
>> > the endianness of the processor / VM ?
>> >
>> > Thanks,
>> >
>> > Clement
>> >
>>
>>
>>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150318/fa1aece4/attachment.htm


More information about the Vm-dev mailing list