From 9a5b458d4e02d3ecc4b92de0c16e9abd2f851dcd Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 2 May 2015 08:02:17 +0000 Subject: [PATCH] * allocate registers properly before icall * use emit_mov to load registers before icall git-svn-id: trunk@30758 - --- compiler/avr/cgcpu.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/avr/cgcpu.pas b/compiler/avr/cgcpu.pas index 926069c960..410e61e03e 100644 --- a/compiler/avr/cgcpu.pas +++ b/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;