<div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace">I found this code on the net:</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style><font face="courier new, monospace"><a href="http://code.google.com/p/fpos/source/browse/kernel/cpuid.pas?r=c387b381d7a05f9328693cdcf59b0b4f633294e4">http://code.google.com/p/fpos/source/browse/kernel/cpuid.pas?r=c387b381d7a05f9328693cdcf59b0b4f633294e4</a></font><br></div><div class="gmail_default" style><font face="courier new, monospace"><br></font></div><div class="gmail_default" style><font face="courier new, monospace">It's part of the "FreePascal Operationg System" project. I suppose it is compatible with FreePascal of course. But while compiled, I got lots of errors, such as:</font></div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style><div class="gmail_default" style><font face="courier new, monospace">cpuid.pas(28,3) Error: Unrecognized opcode pushfd</font></div><div class="gmail_default" style><font face="courier new, monospace">cpuid.pas(29,10) Error: Unknown identifier "EAX"</font></div><div class="gmail_default" style><font face="courier new, monospace">cpuid.pas(30,13) Error: Unknown identifier "EDX"</font></div><div style="font-family:'courier new',monospace"><br></div></div><div class="gmail_extra"><div class="gmail_default" style="font-family:'courier new',monospace">Even I added {$mode objfpc}{$H+} does not help.</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">I tried to compile this code on this platform:</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">CPU: i3 M 390</div><div class="gmail_default" style="font-family:'courier new',monospace">OS: Ubuntu x64</div><div class="gmail_default" style="font-family:'courier new',monospace">FPC: 2.6.4</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">How to use assembly in fpc anyway?</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Thanks.</div><br><div class="gmail_quote">2014-09-12 22:28 GMT+08:00 Dmitry Boyarintsev <span dir="ltr"><<a href="mailto:skalogryz.lists@gmail.com" target="_blank">skalogryz.lists@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If you're talking bout x88_64, i386 platforms, you should be able to do it using CPUID instruction<br></div><div><br><a href="http://en.wikipedia.org/wiki/CPUID" target="_blank">http://en.wikipedia.org/wiki/CPUID</a><br><br>thanks,<br>Dmitry<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Sep 12, 2014 at 10:07 AM, Xiangrong Fang <span dir="ltr"><<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="font-family:courier new,monospace">Hi All,</div><div style="font-family:courier new,monospace"><br></div><div style="font-family:courier new,monospace">Is there a platform independent (specifically Windows and Linux) way to detect cores and hyper-threads of the CPU? I am writing a calculation intensive app and would like to fully utilize SMP capability of the CPU.</div><div style="font-family:courier new,monospace"><br></div><div style="font-family:courier new,monospace">Thanks!</div><span><font color="#888888"><div style="font-family:courier new,monospace">Xiangrong</div><div style="font-family:courier new,monospace"><br></div></font></span></div>
<br></div></div>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div></div>