<div dir="ltr">Hello,<div><br></div><div style>I'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)>>floatValueOf:</div><div>InterpreterSimulatorLSB(Interpreter)>>loadFloatOrIntFrom:</div>
<div>InterpreterSimulatorLSB(Interpreter)>>primitiveFloatEqual:toArg:</div><div>InterpreterSimulatorLSB(Interpreter)>>bytecodePrimEqual</div><div>InterpreterSimulatorLSB(InterpreterSimulator)>>dispatchOn:in:</div>
<div>InterpreterSimulatorLSB(InterpreterSimulator)>>test</div><div>UndefinedObject>>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>"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."</div><div><br></div><div><span class="" style="white-space:pre">        </span>| isFloat result |</div><div><span class="" style="white-space:pre">        </span><returnTypeC: #double></div>
<div><span class="" style="white-space:pre">        </span><var: #result type: #double></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: '' 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>>isInstanceOfClassFloat: oop</div><div>
<span class="" style="white-space:pre">        </span><inline: true></div><div><span class="" style="white-space:pre">        </span>"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."</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>