Browse Source

* i8086: Fixed referencing using BP and SP as base when FAR or HUGE memory model is used.

git-svn-id: trunk@45846 -
yury 5 years ago
parent
commit
34a5dfc885
1 changed files with 8 additions and 2 deletions
  1. 8 2
      compiler/i8086/hlcgcpu.pas

+ 8 - 2
compiler/i8086/hlcgcpu.pas

@@ -292,8 +292,14 @@ implementation
             ref.segment:=NR_GS;
           x86pt_far,
           x86pt_huge:
-            if reg<>NR_NO then
-              ref.segment:=cg.GetNextReg(reg);
+            if getsupreg(reg)>=first_int_imreg then
+              ref.segment:=cg.GetNextReg(reg)
+            else
+              if reg<>NR_NO then
+                if (reg=current_procinfo.framepointer) or (reg=NR_SP) then
+                  ref.segment:=NR_SS
+                else
+                  internalerror(2020072401);
         end;
     end;