Browse Source

+ GetOffsetReg64

git-svn-id: trunk@22837 -
florian 12 years ago
parent
commit
d1b2a7732a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      compiler/avr/cpubase.pas

+ 12 - 0
compiler/avr/cpubase.pas

@@ -317,7 +317,10 @@ unit cpubase;
     { returns the last virtual register }
     function GetLastReg(const r : TRegister) : TRegister;
 
+    { returns the register with the offset of ofs of a continuous set of register starting with r }
     function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
+    { returns the register with the offset of ofs of a continuous set of register starting with r and being continued with rhi }
+    function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
 
   implementation
 
@@ -463,4 +466,13 @@ unit cpubase;
       end;
 
 
+    function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
+      begin
+        if ofs>3 then
+          result:=TRegister(longint(rhi)+ofs-4)
+        else
+          result:=TRegister(longint(r)+ofs);
+      end;
+
+
 end.