Found during reporting #943579:
tglase@tglase-nb:~ $ cat x.s
.globl main
main:
.byte 0x66, 0x31, 0xc9, 0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x66, 0x51, 0x66, 0x9d, 0x8e, 0xc1
tglase@tglase-nb:~ $ as --32 x.s
tglase@tglase-nb:~ $ objdump -d -Mintel,i8086 a.out
a.out: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
0: 66 31 c9 xor ecx,ecx
3: 8e d1 mov ss,cx
5: bc fc 7b mov sp,0x7bfc
8: 66 51 push ecx
a: 66 9d popf
c: 8e c1 mov es,cx
Expected is “popfd” for 66 9D in 16-bit mode (just 9D is “popf”,
and in 32-bit mode, 9D is “popfd” and 66 9D is “popfw”). While
nasm gets this wrong assembling, ndisasm gets it right.