Prechádzať zdrojové kódy

+ handle all registers properly in reg_cgsize

git-svn-id: branches/z80@44804 -
nickysn 5 rokov pred
rodič
commit
ce598813fa
1 zmenil súbory, kde vykonal 11 pridanie a 4 odobranie
  1. 11 4
      compiler/z80/cpubase.pas

+ 11 - 4
compiler/z80/cpubase.pas

@@ -347,10 +347,17 @@ unit cpubase;
     function reg_cgsize(const reg: tregister): tcgsize;
       begin
         case getregtype(reg) of
-          R_INTREGISTER :
-            reg_cgsize:=OS_8;
-          R_ADDRESSREGISTER :
-            reg_cgsize:=OS_16;
+          R_INTREGISTER,
+          R_SPECIALREGISTER:
+            case getsubreg(reg) of
+              R_SUBL,
+              R_SUBH:
+                reg_cgsize:=OS_8;
+              R_SUBW:
+                reg_cgsize:=OS_16;
+              else
+                internalerror(2020041901);
+            end;
           else
             internalerror(2011021905);
           end;