The MASM Forum

64 bit assembler => 64 bit assembler. Conceptual Issues => Topic started by: Gunther on May 09, 2014, 04:17:01 AM

Title: Instruction Set Detection for Linux, BSD and Mac OS
Post by: Gunther on May 09, 2014, 04:17:01 AM
This is the instruction set detection for the 64-bit *nixes (Linux, BSD, Mac OS). The appropriate 64-bit Windows version can be found here (http://masm32.com/board/index.php?topic=1405.0), a 32-bit Windows version exists here (http://masm32.com/board/index.php?topic=1418.0). A new thread is necessary, because the 64-bit ABIs for Unix and Windows are very different.

For a detailed description of the files, please check the file readme.txt. The code is well commented and self-explanatory. Here is the output of the program:
Quote
   Supported Features by Processor and Operating System
   ====================================================

Vendor String: GenuineIntel
Brand  String: Intel(R)Core(TM)i7-3770CPU@3.40GHz

   Instruction Sets
   ----------------

MMX  SSE  SSE2  SSE3  SSSE3  SSE4.1  SSE4.2  AVX

   Supported Special Instructions
   ------------------------------

Conditional Moves
FXSAVE and FXSTOR
XSAVE and XSTOR for processor extended state management.
POPCNT
RDRAND
AES (Advanced Encryption Standard) Instruction Set
16-bit floating-point Conversion Instructions

Please, press enter to end the application ...


Your help and test results are very welcome.

Gunther
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: Gunner on May 09, 2014, 11:32:49 AM
Quote~/projects/64/IsetUnix $ ./cpu
   Supported Features by Processor and Operating System
   ====================================================

Vendor String: AuthenticAMD
Brand  String: AMDPhenom(tm)IIX4955Processor

   Instruction Sets
   ----------------

MMX  SSE  SSE2  SSE3

   Supported Special Instructions
   ------------------------------

Conditional Moves
FXSAVE and FXSTOR

Please, press enter to end the application ...

A FYI, when unzipped, the exe lost the executable permission.
Quotels -l ./cpu
-rw-r--r-- 1 gunner gunner 14090 May  8 19:22 ./cpu

Maybe use tar for your *NIX archives?
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: Gunther on May 10, 2014, 01:51:58 AM
Gunner,

thank you for testing the software.

Quote from: Gunner on May 09, 2014, 11:32:49 AM
A FYI, when unzipped, the exe lost the executable permission.
Quotels -l ./cpu
-rw-r--r-- 1 gunner gunner 14090 May  8 19:22 ./cpu

Maybe use tar for your *NIX archives?

yes, you're right. I should form a tar ball, which can be ziped, to meet the requirements of our forum.

Gunther
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: dedndave on May 10, 2014, 02:55:30 AM
Quote from: Gunther on May 10, 2014, 01:51:58 AM
I should form a tar ball...

you LINUX guys crack me up   :lol:

hey Rob !!! long time no see   :t
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: Gunther on May 10, 2014, 04:04:54 AM
Dave,

Quote from: dedndave on May 10, 2014, 02:55:30 AM
you LINUX guys crack me up   :lol:

that's life.

Gunther
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: DarkWolf on June 13, 2014, 11:39:51 AM
Hey gunther
on my system I get this error.

Which is weird cause I never had a problem running a exe in my home folder (or subfolder) before.

$ ./cpu
bash: ./cpu: cannot execute binary file
Title: Re: Instruction Set Detection for Linux, BSD and Mac OS
Post by: Gunther on June 14, 2014, 01:38:32 AM
Hi DarkWolf,

Quote from: DarkWolf on June 13, 2014, 11:39:51 AM
Hey gunther
on my system I get this error.

Which is weird cause I never had a problem running a exe in my home folder (or subfolder) before.

$ ./cpu
bash: ./cpu: cannot execute binary file

That's very strange. But you can re-build the ELF and it should start. Can you try this?

Gunther