[Pharo-project] [NativeBoost] fxch instruction not working... crash

Lawson English lenglish5 at cox.net
Sat Jul 21 23:27:49 EDT 2012

Still playing with Native Boost assembler.

This code instantly crashes Pharo 1.4 with NB installed:

TestAssem swapDoubFirst: 1.0 withSecond: 2.0.

TestAssem>>swapDoubFirst: r1 withSecond: r2

     <primitive: #primitiveNativeCall module: #NativeBoostPlugin>

     ^ NBFFICallout cdecl: #( double ( double r1, double r2 ))
     emitCall: [:gen | | asm  proxy smpfr scnt|
         asm := gen asm.
         proxy := gen proxy.

         asm pop: asm ECX.
         asm fld:  asm ESP ptr64 .
         asm fld:  asm ESP  ptr64 + 8 .

             asm fxch: asm ST0.

Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner).

More information about the Pharo-dev mailing list