Added 32-bit BSF and BSR
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1046
This commit is contained in:
parent
a3b63b239b
commit
6f9016c8eb
3 changed files with 28 additions and 2 deletions
|
@ -496,6 +496,19 @@ switch (inst.code.op) {
|
|||
SETFLAGBIT(ZF,false);
|
||||
}
|
||||
break;
|
||||
case O_BSFd:
|
||||
{
|
||||
FILLFLAGS;
|
||||
if (!inst.op1.d) SETFLAGBIT(ZF,true);
|
||||
Bitu count=0;
|
||||
while (count<32) {
|
||||
if ((inst.op1.d>>count) & 1) break;
|
||||
count++;
|
||||
}
|
||||
inst.op1.d=count;
|
||||
SETFLAGBIT(ZF,false);
|
||||
}
|
||||
break;
|
||||
case O_BSRw:
|
||||
{
|
||||
FILLFLAGS;
|
||||
|
@ -509,6 +522,19 @@ switch (inst.code.op) {
|
|||
SETFLAGBIT(ZF,false);
|
||||
}
|
||||
break;
|
||||
case O_BSRd:
|
||||
{
|
||||
FILLFLAGS;
|
||||
if (!inst.op1.d) SETFLAGBIT(ZF,true);
|
||||
Bits count=31;
|
||||
while (count>0) {
|
||||
if ((inst.op1.d>>count) & 1) break;
|
||||
count--;
|
||||
}
|
||||
inst.op1.d=count;
|
||||
SETFLAGBIT(ZF,false);
|
||||
}
|
||||
break;
|
||||
case O_BTw:
|
||||
case O_BTSw:
|
||||
case O_BTCw:
|
||||
|
|
|
@ -668,7 +668,7 @@ static OpCode OpCodeTable[1024]={
|
|||
/* 0x3b8 - 0x3bf */
|
||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||
{L_MODRM ,0xf ,0 ,M_GRP },{L_MODRM ,O_BTCd ,0 ,0 },
|
||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||
{L_MODRM ,O_BSFd ,S_Gd ,M_Ed },{L_MODRM ,O_BSRd ,S_Gd ,M_Ed },
|
||||
{L_MODRM ,0 ,S_Gd ,M_Ebx },{L_MODRM ,0 ,S_Gd ,M_Ewx },
|
||||
|
||||
/* 0x3c0 - 0x3cc */
|
||||
|
|
|
@ -87,7 +87,7 @@ enum {
|
|||
|
||||
O_BTw,O_BTSw,O_BTRw,O_BTCw,
|
||||
O_BTd,O_BTSd,O_BTRd,O_BTCd,
|
||||
O_BSFw,O_BSRw,
|
||||
O_BSFw,O_BSRw,O_BSFd,O_BSRd,
|
||||
|
||||
O_BSWAP,
|
||||
O_FPU,
|
||||
|
|
Loading…
Add table
Reference in a new issue