mirror of
https://github.com/holub/mame
synced 2025-05-24 06:30:04 +03:00
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Fix i386 bsr implementation Hi mamedev, The i386 cpu emulator will return the wrong result for bsr when the highest bit is set (0 instead of 15 or 31). The attached patch fixes this. ~aa
This commit is contained in:
parent
5ad309b60f
commit
0921968934
@ -315,7 +315,7 @@ static void I386OP(bsr_r16_rm16)(void) // Opcode 0x0f bd
|
||||
I.ZF = 1;
|
||||
} else {
|
||||
I.ZF = 0;
|
||||
temp = 15;
|
||||
dst = temp = 15;
|
||||
while( (src & (1 << temp)) == 0 ) {
|
||||
temp--;
|
||||
dst = temp;
|
||||
|
@ -317,7 +317,7 @@ static void I386OP(bsr_r32_rm32)(void) // Opcode 0x0f bd
|
||||
I.ZF = 1;
|
||||
} else {
|
||||
I.ZF = 0;
|
||||
temp = 31;
|
||||
dst = temp = 31;
|
||||
while( (src & (1 << temp)) == 0 ) {
|
||||
temp--;
|
||||
dst = temp;
|
||||
|
Loading…
Reference in New Issue
Block a user