Browse Source

* allocate registers properly before icall
* use emit_mov to load registers before icall

git-svn-id: trunk@30758 -

florian 10 years ago
parent
commit
9a5b458d4e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compiler/avr/cgcpu.pas

+ 3 - 3
compiler/avr/cgcpu.pas

@@ -402,12 +402,12 @@ unit cgcpu;
     procedure tcgavr.a_call_reg(list : TAsmList;reg: tregister);
       begin
         a_reg_alloc(list,NR_ZLO);
+        emit_mov(list,NR_ZLO,reg);
         a_reg_alloc(list,NR_ZHI);
-        list.concat(taicpu.op_reg_reg(A_MOV,NR_ZLO,reg));
-        list.concat(taicpu.op_reg_reg(A_MOV,NR_ZHI,GetHigh(reg)));
+        emit_mov(list,NR_ZHI,GetHigh(reg));
         list.concat(taicpu.op_none(A_ICALL));
-        a_reg_dealloc(list,NR_ZLO);
         a_reg_dealloc(list,NR_ZHI);
+        a_reg_dealloc(list,NR_ZLO);
 
         include(current_procinfo.flags,pi_do_call);
       end;