3

The Microsoft MASM language includes a .K3D directive. The docs are sparse:

Enables assembly of K3D instructions.

Inferring from other directives this seems to be an x86 ISA extension.

I find no instance of the term in the entire Intel Architecture docs. A Google search on intel.com shows 8 results total with nothing useful. A Google search on microsoft.com finds only the MASM docs.

What is the K3D x86 ISA extension? Are there docs available?

  • 3
    It's probably the AMD 3DNow! extension. – Ross Ridge Jun 02 '17 at 16:19
  • 1
    Ross is correct, but for a specific external reference to this AMD supplied a [porting guide for 3DNow](http://www.amd-k6.com/wp-content/uploads/2012/07/22621.pdf) that discusses MASM and changes made to it (years ago) to support the 3D Now extensions via the `.K3D` directive - on page 8. – Michael Petch Jun 02 '17 at 16:28

1 Answers1

3

The .K3D directive was added to MASM in version 6.13.

From http://www.amd-k6.com/wp-content/uploads/2012/07/22621.pdf page 8:

To enable MMX instructions, use the .MMX directive.
To enable 3DNow! instructions, use the .K3D directive after using the .MMX directive.
It is order dependent.

If I read the AMD docs correctly you need to enable .MMX prior to enabling .K3D.

The etymology of the term is as follows:
AMD labelled its processors K5, K6, K7 etc.
This aligned with the P5, P6 that Intel used.
Thus the K stands for 'AMD-K' series and the 3D maps to '3D-Now'.

The Masm release notes for 6.13 are just as sparse as the docs:

   .K3D Directive in MASM 6.13
     ---------------------------------------------------------------------
     The .K3D directive enables assembly of K3D instructions.  Users can
     check to see that @Version is 613 or higher to tell if the version
     of MASM being used supports the .K3D directive and K3D instructions.

Johan
  • 74,508
  • 24
  • 191
  • 319