I created a 16-bit DOS executable, and changed the code to preserve the flags on the stack for each BSR and display them separately.
.model small,c
.386
include support.asm
.stack
.data
.code
.startup
xor eax, eax
xor edx, edx
xor ecx, ecx
bsr eax, eax
pushf
bsr edx, edx
pushf
bsr ecx, ecx
pushf
print "bsr reg, samereg(0):",NL
print dword$(eax),chr$(9)
print dword$(edx),chr$(9)
print dword$(ecx),NL
popf
call dumpflags
popf
call dumpflags
popf
call dumpflags
mov eax, 12345678h
mov edx, eax
mov ecx, eax
xor esi, esi
bsr eax, esi
pushf
bsr edx, esi
pushf
bsr ecx, esi
pushf
print "bsr reg(12345678), otherreg(0):",NL
print hexdword$(eax),"h",chr$(9)
print hexdword$(edx),"h",chr$(9)
print hexdword$(ecx),"h",NL
popf
call dumpflags
popf
call dumpflags
popf
call dumpflags
print NL
call waitkey
.exit
end
Results running on my P4 Northwood system under Windows XP, my P3 system under WindowsXP, my P2 system under Windows ME, and my old IBM SLC2-66 system under MS-DOS 6.22:
bsr reg, samereg(0):
0 0 0
NV UP EI PL ZR NA PE NC
NV UP EI PL ZR NA PE NC
NV UP EI PL ZR NA PE NC
bsr reg(12345678), otherreg(0):
12345678h 12345678h 12345678h
NV UP EI PL ZR NA PE NC
NV UP EI PL ZR NA PE NC
NV UP EI PL ZR NA PE NC
Unfortunately, my AMD-K5 system is down.