PRB: 8087 mnemonics without Operators

Last reviewed: January 9, 1995
Article ID: Q11339
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, versions 1.25, 5.0, 5.1, and 6.0
  • Microsoft Macro Assembler for OS/2, versions 5.1 and 6.0

SYMPTOMS

When assembled with no operands, the 8087 instructions FADD, FDIV, FDIVR, FMUL, FSUB, and FSUBR assemble as if they were the instructions "FADDP ST(1),ST", "FDIVP ST(1),ST", and so forth.

CAUSE

The assembler is correct. When used with no operands, these instructions perform "classical stack" operations.

MORE INFORMATION

The following is from Pages 6-23 of the "Intel iAPX 86/88, 186/188 User's Manual Programmer's Reference":

The classical stack form may be used to make the 8087 operate like a classical stack machine. No operands are coded in this form, only the instruction mnemonic. The NDP (8087) picks the source operand from the stack top and the destination from the next stack element. It then pops the stack, performs the operation, and returns the result to the new stack top, effectively replacing the operands by the result.

Note: FADD, FSUB, FMUL, and FDIV also pop if no operands are specified, in spite of the fact that the mnemonics do not have P as a last character.

A similar passage can be found on Pages 2-5 of the Numeric Supplement to the "iAPX 286 Programmer's Reference" manual.


Additional reference words: 1.25 5.00 5.10 6.00
KBCategory: kbprg kbprb
KBSubCategory: MASMLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 9, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.