mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 10:59:10 +02:00
* due to avr's harvard architecture, loads of code labels need to use the gs(...) macro
git-svn-id: trunk@30559 -
This commit is contained in:
parent
34c7f45637
commit
4d01271944
@ -128,8 +128,12 @@ unit agavrgas;
|
||||
case refaddr of
|
||||
addr_hi8:
|
||||
s:='hi8('+s+')';
|
||||
addr_hi8_gs:
|
||||
s:='hi8(gs('+s+'))';
|
||||
addr_lo8:
|
||||
s:='lo8('+s+')';
|
||||
addr_lo8_gs:
|
||||
s:='lo8(gs('+s+'))';
|
||||
else
|
||||
s:='('+s+')';
|
||||
end;
|
||||
|
@ -843,12 +843,20 @@ unit cgcpu;
|
||||
reference_reset(tmpref,0);
|
||||
tmpref.symbol:=ref.symbol;
|
||||
tmpref.offset:=ref.offset;
|
||||
tmpref.refaddr:=addr_lo8;
|
||||
if assigned(ref.symbol) and (ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) then
|
||||
tmpref.refaddr:=addr_lo8_gs
|
||||
else
|
||||
tmpref.refaddr:=addr_lo8;
|
||||
maybegetcpuregister(list,tmpreg);
|
||||
list.concat(taicpu.op_reg_ref(A_LDI,tmpreg,tmpref));
|
||||
tmpref.refaddr:=addr_hi8;
|
||||
|
||||
if assigned(ref.symbol) and (ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) then
|
||||
tmpref.refaddr:=addr_hi8_gs
|
||||
else
|
||||
tmpref.refaddr:=addr_hi8;
|
||||
maybegetcpuregister(list,GetNextReg(tmpreg));
|
||||
list.concat(taicpu.op_reg_ref(A_LDI,GetNextReg(tmpreg),tmpref));
|
||||
|
||||
if (ref.base<>NR_NO) then
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_ADD,tmpreg,ref.base));
|
||||
@ -1623,10 +1631,19 @@ unit cgcpu;
|
||||
reference_reset(tmpref,0);
|
||||
tmpref.symbol:=ref.symbol;
|
||||
tmpref.offset:=ref.offset;
|
||||
tmpref.refaddr:=addr_lo8;
|
||||
|
||||
if assigned(ref.symbol) and (ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) then
|
||||
tmpref.refaddr:=addr_lo8_gs
|
||||
else
|
||||
tmpref.refaddr:=addr_lo8;
|
||||
list.concat(taicpu.op_reg_ref(A_LDI,r,tmpref));
|
||||
tmpref.refaddr:=addr_hi8;
|
||||
|
||||
if assigned(ref.symbol) and (ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) then
|
||||
tmpref.refaddr:=addr_hi8_gs
|
||||
else
|
||||
tmpref.refaddr:=addr_hi8;
|
||||
list.concat(taicpu.op_reg_ref(A_LDI,GetNextReg(r),tmpref));
|
||||
|
||||
if (ref.base<>NR_NO) then
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_ADD,r,ref.base));
|
||||
|
@ -95,7 +95,9 @@ interface
|
||||
{$ENDIF}
|
||||
{$IFDEF AVR}
|
||||
,addr_lo8
|
||||
,addr_lo8_gs
|
||||
,addr_hi8
|
||||
,addr_hi8_gs
|
||||
{$ENDIF}
|
||||
{$IFDEF i8086}
|
||||
,addr_dgroup // the data segment group
|
||||
|
Loading…
Reference in New Issue
Block a user