mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 09:10:56 +00:00
[SOFT386]
Implement the INT, INT3 and INTO instructions (all 3 in Soft386OpcodeInt). svn path=/branches/ntvdm/; revision=60256
This commit is contained in:
parent
1d3d2fc07a
commit
34157419d7
2 changed files with 59 additions and 21 deletions
|
@ -228,9 +228,9 @@ Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS] =
|
|||
Soft386OpcodeLeave,
|
||||
Soft386OpcodeRetFarImm,
|
||||
Soft386OpcodeRetFar,
|
||||
Soft386OpcodeInt3,
|
||||
Soft386OpcodeInt,
|
||||
Soft386OpcodeIntOverflow,
|
||||
Soft386OpcodeInt,
|
||||
Soft386OpcodeInt,
|
||||
Soft386OpcodeIret,
|
||||
NULL, // TODO: OPCODE 0xD0 NOT SUPPORTED
|
||||
NULL, // TODO: OPCODE 0xD1 NOT SUPPORTED
|
||||
|
@ -4297,28 +4297,68 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeRetFar)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeInt3)
|
||||
{
|
||||
// TODO: NOT IMPLEMENTED
|
||||
UNIMPLEMENTED;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeInt)
|
||||
{
|
||||
// TODO: NOT IMPLEMENTED
|
||||
UNIMPLEMENTED;
|
||||
UCHAR IntNum;
|
||||
SOFT386_IDT_ENTRY IdtEntry;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
switch (Opcode)
|
||||
{
|
||||
case 0xCC:
|
||||
{
|
||||
/* This is the INT3 instruction */
|
||||
IntNum = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeIntOverflow)
|
||||
{
|
||||
// TODO: NOT IMPLEMENTED
|
||||
UNIMPLEMENTED;
|
||||
case 0xCD:
|
||||
{
|
||||
/* Fetch the interrupt number */
|
||||
if (!Soft386FetchByte(State, &IntNum))
|
||||
{
|
||||
/* Exception occurred */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
case 0xCE:
|
||||
{
|
||||
/* Don't do anything if OF is cleared */
|
||||
if (!State->Flags.Of) return TRUE;
|
||||
|
||||
/* Exception #OF */
|
||||
IntNum = SOFT386_EXCEPTION_OF;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
/* Should not happen */
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the interrupt vector */
|
||||
if (!Soft386GetIntVector(State, IntNum, &IdtEntry))
|
||||
{
|
||||
/* Exception occurred */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Perform the interrupt */
|
||||
if (!Soft386InterruptInternal(State,
|
||||
IdtEntry.Selector,
|
||||
MAKELONG(IdtEntry.Offset, IdtEntry.OffsetHigh),
|
||||
IdtEntry.Type))
|
||||
{
|
||||
/* Exception occurred */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeIret)
|
||||
|
|
|
@ -122,9 +122,7 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeEnter);
|
|||
SOFT386_OPCODE_HANDLER(Soft386OpcodeLeave);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeRetFarImm);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeRetFar);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeInt3);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeInt);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeIntOverflow);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeIret);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeAam);
|
||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeAad);
|
||||
|
|
Loading…
Reference in a new issue