<div dir="ltr">Hello,<div><br></div><div style>I&#39;ve been working on getting the simulator to work from VMMaker.</div><div style><br></div><div style>Now, I can load my 6505 formatted image inside the simulator and it looks okay (from what I can inspect).</div>

<div style><br></div><div style>Then, I am now running the test of the sim:</div><div style><br></div><div style><div>test</div><div><span class="" style="white-space:pre">        </span>transcript clear.</div><div><span class="" style="white-space:pre">        </span>byteCount := 0.</div>

<div><span class="" style="white-space:pre">        </span>quitBlock := [^ self].</div><div><span class="" style="white-space:pre">        </span>self internalizeIPandSP.</div><div><span class="" style="white-space:pre">        </span>self fetchNextBytecode.</div>

<div><span class="" style="white-space:pre">        </span>[true] whileTrue:</div><div><span class="" style="white-space:pre">                </span>[self dispatchOn: currentBytecode in: BytecodeTable.</div><div><span class="" style="white-space:pre">                </span>byteCount := byteCount + 1.</div>

<div><span class="" style="white-space:pre">                </span>byteCount \\ 10000 = 0 ifTrue: [self fullDisplay]].</div><div><span class="" style="white-space:pre">        </span>self externalizeIPandSP.</div><div><br></div><div><br></div>

<div style>and I hit an issue:</div><div style><br></div><div style>MNU: isInstanceOfClassFloat: oop.</div><div style><div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;floatValueOf:</div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;loadFloatOrIntFrom:</div>

<div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;primitiveFloatEqual:toArg:</div><div>InterpreterSimulatorLSB(Interpreter)&gt;&gt;bytecodePrimEqual</div><div>InterpreterSimulatorLSB(InterpreterSimulator)&gt;&gt;dispatchOn:in:</div>

<div>InterpreterSimulatorLSB(InterpreterSimulator)&gt;&gt;test</div><div>UndefinedObject&gt;&gt;DoIt</div><div><br></div></div><div style>This happens here:</div><div style><br></div><div><div>floatValueOf: oop</div><div>

<span class="" style="white-space:pre">        </span>&quot;Answer the C double precision floating point value of the argument,</div><div><span class="" style="white-space:pre">        </span> or fail if it is not a Float, and answer 0.</div>

<div><span class="" style="white-space:pre">        </span> Note: May be called by translated primitive code.&quot;</div><div><br></div><div><span class="" style="white-space:pre">        </span>| isFloat result |</div><div><span class="" style="white-space:pre">        </span>&lt;returnTypeC: #double&gt;</div>

<div><span class="" style="white-space:pre">        </span>&lt;var: #result type: #double&gt;</div><div><span class="" style="white-space:pre">        </span>isFloat := self isInstanceOfClassFloat: oop.</div><div><span class="" style="white-space:pre">        </span>isFloat ifTrue:</div>

<div><span class="" style="white-space:pre">                </span>[self cCode: &#39;&#39; inSmalltalk: [result := Float new: 2].</div><div><span class="" style="white-space:pre">                </span> self fetchFloatAt: oop + BaseHeaderSize into: result.</div>

<div><span class="" style="white-space:pre">                </span> ^result].</div><div><span class="" style="white-space:pre">        </span>self primitiveFail.</div><div><span class="" style="white-space:pre">        </span>^0.0</div></div><div><br>

</div><div style>There is such a method in IntepreterPrimitives, but not in the Interpreter itself nor parents.</div><div style><br></div><div style><div>InterpreterPrimitives&gt;&gt;isInstanceOfClassFloat: oop</div><div>

<span class="" style="white-space:pre">        </span>&lt;inline: true&gt;</div><div><span class="" style="white-space:pre">        </span>&quot;N.B.  Because Slang always inlines is:instanceOf:compactClassIndex:</div><div><span class="" style="white-space:pre">        </span> (because is:instanceOf:compactClassIndex: has an inline: pragma) the</div>

<div><span class="" style="white-space:pre">        </span> phrase (objectMemory splObj: ClassFloat) is expanded in-place and is</div><div><span class="" style="white-space:pre">        </span> _not_ evaluated if oop has a non-zero CompactClassIndex.&quot;</div>

<div><span class="" style="white-space:pre">        </span>^objectMemory</div><div><span class="" style="white-space:pre">                </span>is: oop</div><div><span class="" style="white-space:pre">                </span>instanceOf: (objectMemory splObj: ClassFloat) </div>

<div><span class="" style="white-space:pre">                </span>compactClassIndex: ClassFloatCompactIndex</div><div><br></div><div style>Clues?</div><div style><br></div><div style>Phil</div></div></div></div></div>