Browse Source

+ temporary hack/workaround for the 6502 imaginary registers overlap

Nikolay Nikolov 1 year ago
parent
commit
db49855871
2 changed files with 6 additions and 1 deletions
  1. 5 0
      compiler/cgutils.pas
  2. 1 1
      compiler/mos6502/cpubase.pas

+ 5 - 0
compiler/cgutils.pas

@@ -33,11 +33,16 @@ unit cgutils;
       cpubase,cgbase;
       cpubase,cgbase;
 
 
     const
     const
+{$ifdef MOS6502}
+      { temporary hack, due to the lack of large sets support }
+      maxcpuregister = 255;
+{$else MOS6502}
       { implementation of max function using only functionality that can be
       { implementation of max function using only functionality that can be
         evaluated as a constant expression by the compiler -- this is
         evaluated as a constant expression by the compiler -- this is
         basically maxcpureg = max(max(first_int_imreg,first_fpu_imreg),first_mm_imreg)-1 }
         basically maxcpureg = max(max(first_int_imreg,first_fpu_imreg),first_mm_imreg)-1 }
       tmpmaxcpufpuintreg = first_int_imreg + ((first_fpu_imreg - first_int_imreg) * ord(first_int_imreg < first_fpu_imreg));
       tmpmaxcpufpuintreg = first_int_imreg + ((first_fpu_imreg - first_int_imreg) * ord(first_int_imreg < first_fpu_imreg));
       maxcpuregister = (tmpmaxcpufpuintreg + ((first_mm_imreg - tmpmaxcpufpuintreg) * ord(tmpmaxcpufpuintreg < first_mm_imreg)))-1;
       maxcpuregister = (tmpmaxcpufpuintreg + ((first_mm_imreg - tmpmaxcpufpuintreg) * ord(tmpmaxcpufpuintreg < first_mm_imreg)))-1;
+{$endif MOS6502}
 
 
     type
     type
       { Set type definition for cpuregisters }
       { Set type definition for cpuregisters }

+ 1 - 1
compiler/mos6502/cpubase.pas

@@ -85,7 +85,7 @@ unit cpubase;
 
 
       { Integer Super registers first and last }
       { Integer Super registers first and last }
       first_int_supreg = RS_A;
       first_int_supreg = RS_A;
-      first_int_imreg = 256;
+      first_int_imreg = 2048;
 
 
       { Float Super register first and last }
       { Float Super register first and last }
       first_fpu_supreg    = RS_INVALID;
       first_fpu_supreg    = RS_INVALID;