Menu

#287 Floating-point opcode difference between MASM and JWasm when using operands st,st

v211
closed
nobody
None
2
2013-10-27
2013-10-07
dosfan01
No

When using st,st on fadd, fmul, fsub, fsubr, fdiv and fdivr, JWasm uses the DCh opcode while MASM uses the D8h opcode.

For example fadd st,st generates D8h C0h in MASM (all versions from 6.00 up) but generates DCh C0h in JWasm. The same occurs if you use any variants like fadd st,st(0) or fadd st(0),st or fadd st(0),st(0)

This appears to be due to the ordering in the tables in instruct.h:

ins (FADD, fadd, 4, OpCls( STI, ST, NONE ), 0, 0, 0, 0xDC, 0xC0, P_87, 0)
insn(FADD, 1, OpCls( ST, STI, NONE ), 0, 0, 0, 0xD8, 0xC0, P_87, 0)

probably should be:

ins (FADD, fadd, 4 OpCls( ST, STI, NONE ), 0, 0, 0, 0xD8, 0xC0, P_87, 0)
insn(FADD, 1, OpCls( STI, ST, NONE ), 0, 0, 0, 0xDC, 0xC0, P_87, 0)

There don't appear to be any issues in changing the order. The same would need to be done for FMUL, FDIV, FDIVR, FSUB and FSUBR.

Discussion

  • japheth

    japheth - 2013-10-09

    Ok, will be changed.

    Btw, such "issues" ( which are no bugs ) should be opened in the discussion forum.

     
  • dosfan01

    dosfan01 - 2013-10-10

    Verified fixed in v2.11 rc17

     
  • japheth

    japheth - 2013-10-27
    • Status: open --> closed
     

Log in to post a comment.