mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 11:49:27 +02:00
* fixes for OP_ADD and OP_SUB in a_op_reg_reg_internal. The destination of add/adc/sub/sbc can only be
register NR_A. git-svn-id: branches/z80@44508 -
This commit is contained in:
parent
d26b5199c8
commit
cae1865f32
@ -434,28 +434,40 @@ unit cgcpu;
|
||||
case op of
|
||||
OP_ADD:
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_ADD,dst,src));
|
||||
getcpuregister(list,NR_A);
|
||||
a_load_reg_reg(list,OS_8,OS_8,dst,NR_A);
|
||||
list.concat(taicpu.op_reg_reg(A_ADD,NR_A,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
|
||||
if size in [OS_S16,OS_16,OS_S32,OS_32,OS_S64,OS_64] then
|
||||
begin
|
||||
for i:=2 to tcgsize2size[size] do
|
||||
begin
|
||||
NextSrcDst;
|
||||
list.concat(taicpu.op_reg_reg(A_ADC,dst,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,dst,NR_A);
|
||||
list.concat(taicpu.op_reg_reg(A_ADC,NR_A,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
|
||||
end;
|
||||
end;
|
||||
ungetcpuregister(list,NR_A);
|
||||
end;
|
||||
|
||||
OP_SUB:
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_SUB,dst,src));
|
||||
getcpuregister(list,NR_A);
|
||||
a_load_reg_reg(list,OS_8,OS_8,dst,NR_A);
|
||||
list.concat(taicpu.op_reg_reg(A_SUB,NR_A,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
|
||||
if size in [OS_S16,OS_16,OS_S32,OS_32,OS_S64,OS_64] then
|
||||
begin
|
||||
for i:=2 to tcgsize2size[size] do
|
||||
begin
|
||||
NextSrcDst;
|
||||
list.concat(taicpu.op_reg_reg(A_SBC,dst,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,dst,NR_A);
|
||||
list.concat(taicpu.op_reg_reg(A_SBC,NR_A,src));
|
||||
a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
|
||||
end;
|
||||
end;
|
||||
ungetcpuregister(list,NR_A);
|
||||
end;
|
||||
|
||||
OP_NEG:
|
||||
|
Loading…
Reference in New Issue
Block a user