Explorar o código

don't save the FP explicitly on a syscall, as they preserve all regs anyway except scratch regs

git-svn-id: trunk@27078 -
Károly Balogh %!s(int64=11) %!d(string=hai) anos
pai
achega
73f8c956e0
Modificáronse 1 ficheiros con 5 adicións e 13 borrados
  1. 5 13
      compiler/m68k/n68kcal.pas

+ 5 - 13
compiler/m68k/n68kcal.pas

@@ -50,27 +50,19 @@ implementation
     procedure tm68kcallnode.do_syscall;
       var
         tmpref: treference;
-	tmpref2: treference;
       begin
         case target_info.system of
           system_m68k_amiga:
             begin
               if po_syscall_legacy in tprocdef(procdefinition).procoptions then
                 begin
-		  { save base pointer on syscalls }
-		  { FIXME: probably this will need to be extended to save all regs (KB) }
-                  reference_reset_base(tmpref2, NR_STACK_POINTER_REG, 0, 4);
-                  tmpref2.direction := dir_dec;
-		  current_asmdata.CurrAsmList.concat(taicpu.op_reg_ref(A_MOVE,S_L,NR_FRAME_POINTER_REG,tmpref2));
-		  
-		  { the actuall call }
+                  { according to Amiga Developer CD 2.1, system functions destroy the
+                    scratch regs D0-D1 and A0-A1, but preserve all other regs. A6 is
+                    not used as FP on Amiga any more (we use A5), so we don't need to
+                    save it. (KB)
+                    http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0290.html }
                   reference_reset_base(tmpref,NR_A6,-tprocdef(procdefinition).extnumber,4);
                   current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_JSR,S_NO,tmpref));
-		  
-		  { restore frame pointer }
-                  reference_reset_base(tmpref2, NR_STACK_POINTER_REG, 0, 4);
-                  tmpref2.direction := dir_inc;
-		  current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(A_MOVE,S_L,tmpref2,NR_FRAME_POINTER_REG));
                 end
               else
                 internalerror(2005010403);