I know for the fact that fasm use the shortest form available to encode instructions, so this not a bug report or whatsoever; but it would be nice to somehow be able to disable this optimization feature.
use32
; pseudo NOP instructions that are valid in 32-bit mode
; from 2 bytes, up to 9 bytes of pseudo NOP instructions
nop2:
; can assemble .......... YES
; assembled correctly ... YES
; expected bytes ....... 66 90
; assembled bytes ....... 66 90
db 66h
nop
nop3:
; can assemble .......... YES
; assembled correctly ... YES
; expected bytes ....... 0f 1f 00
; assembled bytes ....... 0f 1f 00
nop dword [eax]
nop4:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 0f 1f 40 00
; assembled bytes ....... 0f 1f 00
nop dword [eax+00h]
nop5:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 0f 1f 44 00 00
; assembled bytes ....... 0f 1f 04 00
nop dword [eax+eax*1+00h]
nop6:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 66 0f 1f 44 00 00
; assembled bytes ....... 66 0f 1f 04 00
db 66h
nop dword [eax+eax*1+00h]
nop7:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 0f 1f 80 00 00 00 00
; assembled bytes ....... 0f 1f 00
nop dword [eax+00000000h]
nop8:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 0f 1f 84 00 00 00 00 00
; assembled bytes ....... 0f 1f 04 00
nop dword [eax+eax*1+00000000h]
nop9:
; can assemble .......... YES
; assembled correctly ... NO
; expected bytes ....... 66 0f 1f 84 00 00 00 00 00
; assembled bytes ....... 66 0f 1f 04 00
db 66h
nop dword [eax+eax*1+00000000h]