+ else if (ModRegRm.Register == 3)
+ {
+ USHORT Selector;
+ INT Segment = SOFT386_REG_DS;
+
+ /* Check for the segment override */
+ if (State->PrefixFlags & SOFT386_PREFIX_SEG)
+ {
+ /* Use the override segment instead */
+ Segment = State->SegmentOverride;
+ }
+
+ /* Read the selector */
+ if (!Soft386ReadMemory(State,
+ Segment,
+ ModRegRm.MemoryAddress + sizeof(USHORT),
+ FALSE,
+ &Selector,
+ sizeof(USHORT)))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ /* Push the current value of CS */
+ if (!Soft386StackPush(State, State->SegmentRegs[SOFT386_REG_CS].Selector))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ /* Push the current value of IP */
+ if (!Soft386StackPush(State, State->InstPtr.LowWord))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ /* Load the new code segment */
+ if (!Soft386LoadSegment(State, SOFT386_REG_CS, Selector))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ /* Set the IP to the address */
+ State->InstPtr.LowWord = Value;
+
+ }