/* Get the cached descriptor */
CachedDescriptor = &State->SegmentRegs[SegmentReg];
- if ((Offset + Size - 1) > CachedDescriptor->Limit)
+ if (InstFetch || !CachedDescriptor->DirConf)
{
- /* Read beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ if ((Offset + Size - 1) > CachedDescriptor->Limit)
+ {
+ /* Read beyond limit */
+ Fast486Exception(State, FAST486_EXCEPTION_GP);
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (Offset < CachedDescriptor->Limit)
+ {
+ /* Read beyond limit */
+ Fast486Exception(State, FAST486_EXCEPTION_GP);
+ return FALSE;
+ }
}
/* Check for protected mode */
/* Get the cached descriptor */
CachedDescriptor = &State->SegmentRegs[SegmentReg];
- if ((Offset + Size - 1) > CachedDescriptor->Limit)
+ if (!CachedDescriptor->DirConf)
{
- /* Write beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ if ((Offset + Size - 1) > CachedDescriptor->Limit)
+ {
+ /* Write beyond limit */
+ Fast486Exception(State, FAST486_EXCEPTION_GP);
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (Offset < CachedDescriptor->Limit)
+ {
+ /* Read beyond limit */
+ Fast486Exception(State, FAST486_EXCEPTION_GP);
+ return FALSE;
+ }
}
/* Check for protected mode */