<div dir="ltr">Hi!<div><br></div><div>We are here with Stef looking at the calcEndianess method which introduces a dependency to Form and BitBlt from SmalltalkImage.</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>bytes := #[0 0 0 0].  &quot;(1 2 3 4) or (4 3 2 1)&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>word := WordArray with: 16r01020304.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>blt := (BitBlt toForm: (Form new hackBits: bytes)) </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>sourceForm: (Form new hackBits: word).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>blt combinationRule: Form over.  &quot;store&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>blt sourceY: 0; destY: 0; height: 1; width: 4.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>blt sourceX: 0; destX: 0.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>blt copyBits.  &quot;paste the word into the bytes&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>bytes first = 1 ifTrue: [^ #big].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>bytes first = 4 ifTrue: [^ #little].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self error: &#39;Ted is confused&#39;.</div></div><div><br></div><div>Is that code really useful? I mean, usually all machines are little endian now, aren&#39;t they?</div><div><br></div><div>And in case big endianess comes back, shouldn&#39;t be easier and cheaper to do it with just a primitive? It will be much less code than using BitBlt and Form and some calculations, and simpler, and it looks like the responsibility of the VM to know that...</div><div><br></div><div>Guille</div></div>